reset canvas back to original bitmap?

reset canvas back to original bitmap?

Post by Rick Nesbit » Fri, 04 Jul 2003 01:15:17



I have bitmap loaded into a TImage. I draw a polygon on the
canvas. Now I want to take away the polygon and reset the
canvas back to the orignal bitmap. I tried using a buffer to
save the canvas before the polygon, but when I try to assign
the original bitmap, I get the "cannot assign a TBitMapCanvas
to a TBitMapCanvas" error.

How is this supposed to be done??

 
 
 

reset canvas back to original bitmap?

Post by Jens Grusche » Fri, 04 Jul 2003 02:40:07


Quote:> I have bitmap loaded into a TImage. I draw a polygon on the
> canvas. Now I want to take away the polygon and reset the
> canvas back to the orignal bitmap.

Since you didn't make the drawing to the canvas of the bitmap (but the
canvas of the TImage), a simple YourImage.Invalidate should be enough to
clear your drawings (what makes the image redraw itself, and since it
doesn't know about your drawing they are gone). Note that they are also
cleared when you move another window over your image, because this also
causes invalidation (I hope this is what you want, because otherwise you
have to make your drawings to the bitmap of your image or add some WM_PAINT
handler or something similar).

Jens

 
 
 

1. Image->Canvas vs. Bitmap->Canvas Transparency

I have a small bitmap which requires transparent background. It can be
copied to an Image->Canvas with no problem (transparency works OK). But
when I copy the same bitmap to a Graphics::TBitmap Canvas the
transparency is lost. Is this a known difference between TImage and
TBitmap? Is there a workaround, or an added step required?

--
There are two things you must never attempt to prove: the unprovable --
and the obvious.
http://www.crbond.com

2. ri.h: Convert Maya Camera to RIB!

3. back to the original subject of a manual..

4. RIPing and Trapping Easier In Quark

5. object jumps back to original position

6. restore back to the original state.

7. Bitmap of TCanvas and sending fax using bitmap/Canvas

8. Rotating bitmap (mantaining the original boundaries)

9. Original size of bitmap

10. bitmap is inverted on the back side of polygon

11. retrieve Bitmap (Not DIB) from a metafile record back to BMP file