Menu

#13 How to use Graphics32 routines on a regular Canvas?

open
nobody
None
5
2011-04-13
2011-04-13
No

In the Graphics32 documentation there is an example of manipulation of TBitmap32 content using TCanvas routines, but I would like to do the opposite way: I have a HDC from a TListView control for example (Win API event), which I can assign to a TCanvas, and I would like to use TBitmap32 routines on it. Is it possible?

I tired the following code, but it does not work (the image is unchanged):
var Bmp: TBitmap32;
begin
Bmp:= TBitmap32.Create();
Bmp.Canvas.Handle:= DC;
ColorToGrayscale(Bmp, Bmp);
ApplyLUT(Bmp, Bmp, DarkTable);

Discussion