JCL Help:TJclBitmap32.Handle

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Provides the device context handle of the contained DIB.


Pascal

 public property Handle: HDC;


Description

The Handle property provides the device context handle of the contained DIB.
This handle may be used in low-level Windows API calls or, for example, to attach a TCanvas object to TJclBitmap32: var

 Canvas: TCanvas;
begin
Canvas := TCanvas.Create; // create a new independent TCanvas object
try
Canvas.Handle := Bitmap32.Handle; // attach it to the Bitmap32 object
Canvas.Pen.Color := clRed; // use standard TCanvas methods for drawing
Canvas.Brush.Color := clGreen;
Canvas.Ellipse(10, 10, 60, 40);
finally
Canvas.Free;
end;
end;
Handle contains zero, if the bitmap is empty (width or height is zero), and its value can change after resizing.


About

Donator

Alex Denissov


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page