How can I get an Image from a Canvas at runtime....

Hi all,

I have a Delphi application where I do the following:

1. Create a TImage at runtime.
2. Draw dynamically (using StretchDraw) onto the Canvas
3. Display this on a form

This works fine.

I now want to replace a specific colour on the TImage with another one.
I have aroutine that takes a TBitmap and performs the colour replacement, however it does not appear to work with what I am doing above!

The parameter I am calling the function with is "MyTImage.Picture.Bitmap"
I assume this is not the correct paramater to get the modified Canvas

Any ideas what I am doing wrong here?

Thanks,

James

LVL 4
James AtkinSenior Principle Software EngineerAsked:
Who is Participating?
 
epasquierConnect With a Mentor Commented:
ok, not Update as it will not invalidate the Image, but MyImage.Repaint; (= Invalidate + Update )
0
All Courses

From novice to tech pro — start learning today.