Method function IGDIPlus.IGPGraphics.ReleaseHDC(HDC) : TGPGraphics

From Mitov Wiki Doc
Revision as of 17:18, 18 October 2012 by David Alm (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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);

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox