Board index » delphi » Getting the Contents of a TPaintBox

Getting the Contents of a TPaintBox

Dear Friends,

Is it possible to obtain the image being displayed on a TPaintbox into a
TBitmap?

The TPaintbox will be showing at the time this is being done.

I've tried GetFormImage, but it isn't doing it for me.

My intent is to obtain the image in a TPaintBox on a form other than the one
in the unit I'm executing in (in case that makes a difference).

Thanks!

 

Re:Getting the Contents of a TPaintBox


Quote
"Elliott Shevin" <shev...@aol.com> wrote in message

news:3b0af468$1_2@dnews...

Quote
> Is it possible to obtain the image being displayed on a TPaintbox into a
> TBitmap?

The TPaintbox is painted in an OnPaint handler.  Write a routine with a
TCanvas parameter that can be called by the OnPaint to paint on the screen,
or draw on another canvas, such as an in-memory TBitmap.

--
efg     e...@efg2.com     Earl F. Glynn, Overland Park, KS  USA

efg's Computer Lab:  http://www.efg2.com/Lab
Mirror:  http://homepages.borland.com/efg2lab/Default.htm

Re:Getting the Contents of a TPaintBox


Look at http://members.truepath.com/delphi/tips/tip143_iconeditorii1.htm for
a example.

Quote
"Elliott Shevin" <shev...@aol.com> wrote in message

news:3b0af468$1_2@dnews...
Quote
> Dear Friends,

> Is it possible to obtain the image being displayed on a TPaintbox into a
> TBitmap?

> The TPaintbox will be showing at the time this is being done.

> I've tried GetFormImage, but it isn't doing it for me.

> My intent is to obtain the image in a TPaintBox on a form other than the
one
> in the unit I'm executing in (in case that makes a difference).

> Thanks!

Other Threads