Board index » delphi » drawing onto canvas

drawing onto canvas

Problem:
I have a bitman on canvas.

Can anyone know?:
How can I draw something (for example: a solid line) onto canvas, and after
that remove this line without wasting the bitmap ?

 

Re:drawing onto canvas


Quote
Paul Kopylov wrote:

> Problem:
> I have a bitman on canvas.

> Can anyone know?:
> How can I draw something (for example: a solid line) onto canvas, and after
> that remove this line without wasting the bitmap ?

  Bitmap.Canvas.Pen.Mode := pmNotXOR;
  DrawMyLine;
{the line appears - then do some stuff}
...

  Bitmap.Canvas.Pen.Mode := pmNotXOR;
  DrawMyLine; {voila ! it's gone !}
________________________________________

Dr Mat Ballard,
CSIRO Molecular Science,
Bag 10,
Clayton South MDC,
Vic 3169. AUSTRALIA.
tel: 61-3-9545-2425
fax: 61-3-9545-2415
mat.ball...@molsci.csiro.au
URL: http://www.wark.csiro.au/ballard/

Re:drawing onto canvas


In article <388B9992.96CED...@molsci.csiro.au>, Mat Ballard

Quote
<mat.ball...@molsci.csiro.au> writes:
>> Can anyone know?:
>> How can I draw something (for example: a solid line) onto canvas, and after
>> that remove this line without wasting the bitmap ?

>  Bitmap.Canvas.Pen.Mode := pmNotXOR;
>  DrawMyLine;
>{the line appears - then do some stuff}
>...

>  Bitmap.Canvas.Pen.Mode := pmNotXOR;
>  DrawMyLine; {voila ! it's gone !}
>_____________________________

This will work but you won't get a solid line across the bitmap. You'll get a
NotXor'd line. The usual way of drawing lines is to NotXor during the Mouse
move and pmCopy to finish it off in MouseUp to ensure the line is the color you
want. Subsequently NotXoring the line will leave a white line across the
bitmap. AFAIK, the only (simple) way is to re-draw the bitmap.

Gordon.

~~~~~~~~~~~~~~~~~~~~~~~~
Certifiable - definitely <g>

http://members.aol.com/mgcsoft/  (the function junction equation editor)
http://members.aol.com/delphistuf/delphstf.htm   (Delphi bits and bobs and a
few links)

MGCSoft

Other Threads