| |
| Dynamically drawing a transparent image |
 |
How do I use a TImageList component to dynamically draw a transparent image?
The following example demonstrates the dynamic creation of a TImageList component used to draw a transparent bitmap.
Example:
procedure TForm .Button Click(Sender: TObject);
var
bm : TBitmap;
il : TImageList;
begin
bm := TBitmap.Create;
bm.LoadFromFile('C:\DownLoad\TEST.BMP');
il := TImageList.CreateSize(bm.Width,
bm.Height);
il.DrawingStyle := dsTransparent;
il.Masked := true;
il.AddMasked(bm, clRed);
il.Draw(Form .Canvas, 0, 0, 0);
bm.Free;
il.Free;
end;
|
|
| Hits/month |
2,500,000+ |
Downloads (Since May 2000) |
7,393,709 |
| Total Files |
6,023 |
| Forum msgs |
7,670 |
| Articles/FAQs |
70+/900+ |
Top Selling Software at Amazon
|