Method function IGDIPlus.IGPGraphics.ReleaseHDC(HDC) : TGPGraphics
From Mitov Wiki Doc
This is a Beta Read Only version of this page. Please review and send recommendations to mitov@mitov.com. We will enable the editing as soon as we are happy with the overall Wiki site.
Class: IGPGraphics
Contents |
Syntax
Delphi:
function ReleaseHDC( hdc : HDC ) : TGPGraphics;
C++ Builder:
TGPGraphics __fastcall ReleaseHDC( HDC hdc );
Visual C++ (MFC):
ReleaseHDC( hdc );
Summary
Releases a device context handle obtained by a previous call to the TGPGraphics.GetHDC method of this Graphics object.
Description
Call this method to release a device context handle obtained
by a previous call to the TGPGraphics.GetHDC method of this
Graphics object.
Example:
The following function has a pointer to a Graphics object as
its only parameter. The function calls Graphics::GetHDC to
get a handle to the device context associated with the
Graphics object and then passes that device context handle to
the Microsoft Windows Graphics Device Interface
(GDI)Rectangle function. The call to ReleaseHDC releases the
device context handle.
AGraphics->DrawEllipse( TGPPen.Create( aclBlue ), 10, 10, 100, 50); // GDI+
AHdc = AGraphics->GetHDC();
// Make GDI calls, but don't call any methods
// on g until after the call to ReleaseHDC.
Rectangle( AHdc, 120, 10, 220, 60); // GDI
AGraphics->ReleaseHDC(AHdc);
// Ok to call methods on g again.
AGraphics->DrawLine( TGPPen.Create( aclRed ), 240, 10, 340, 60);