Board index » delphi » TImage.Canvas and TPaintBox.Canvas...

TImage.Canvas and TPaintBox.Canvas...

Why, a custom draw in TImage's Canvas it's resistant to the Refresh
procedure, and TPaintBox's Canvas not?
I'm looking for a way to use TPaintBox's  Canvas.Arc, MoveTo, LineTo ....
because it's incredibly fastest that Timage's  Canvas equivalents..., but i
need the TImage's Canvas functionality...
should I try with a Canvas dynamically created, work with it and then assign
it to a TImage???

UnitZZ

--
---------------------------------------------------
JULIAN MAISANO ? / ? 1976
La Plata - Argentina
----------------------------------------------------

 

Re:TImage.Canvas and TPaintBox.Canvas...


Julian,

in article <3c858662_2@dnews>, you wrote:

Quote
> I'm looking for a way to use TPaintBox's  Canvas.Arc, MoveTo, LineTo ....
> because it's incredibly fastest that Timage's  Canvas equivalents..., but i
> need the TImage's Canvas functionality...

Do you have your code in a handler for the OnPaint event of the TPaintBox in
question?

--
Regards
Ralph (TeamB)
==
  Use Borland servers; TeamB doesn't see posts via ISPs
  http://www.borland.com/newsgroups/genl_faqs.html
==
Man soll die Dinge nicht so tragisch nehmen wie sie sind
--Karl Valentin--

Re:TImage.Canvas and TPaintBox.Canvas...


Ralph Friedman (TeamB) <rfte...@friedman-net.com> escribi en el mensaje de
noticias VA.000013c2.0098c...@friedman-net.com...

Quote

> Do you have your code in a handler for the OnPaint event of the TPaintBox
in
> question?

No, i havn't.
I currently work in this way:

procedure ButtonClick.....
   with PaintBox.Canvas do
   begin
      Rectangle(....
      LineTo(...
   .....
   end;
   self.Refresh;  TPaintBox.Canvas is cleaned // Draw performance in a
for/repeat structure is good

but, in this case

procedure ButtonClick.....
   with Image.Canvas do
   begin
      Rectangle(....
      LineTo(...
   .....
   end;
   self.Refresh;  TImage.Canvas isn't cleaned // Draw performance in a
for/repeat structure is too slow

---------------------------------------------------
JULIAN MAISANO ? / ? 1976
La Plata - Argentina
----------------------------------------------------

Re:TImage.Canvas and TPaintBox.Canvas...


Julian,

in article <3c86ebfd_1@dnews>, you wrote:

Quote
> No, i havn't.
> I currently work in this way:

the code should be in the OnPaint handler in order for the effects to appear
persistent.

--
Regards
Ralph (TeamB)
==
  Use Borland servers; TeamB doesn't see posts via ISPs
  http://www.borland.com/newsgroups/genl_faqs.html
==
Man soll die Dinge nicht so tragisch nehmen wie sie sind
--Karl Valentin--

Other Threads