com.moesol.bindings.platform_sdk.windows_api
Class HDC

java.lang.Object
  extended by com.moesol.bindings.platform_sdk.windows_api.HANDLE
      extended by com.moesol.bindings.platform_sdk.windows_api.HDC

public class HDC
extends HANDLE

Wrap a Win32 HDC.


Field Summary
static long BLACKNESS
          Win32 constant
static int CLR_INVALID
          Win32 constant
static long DSTINVERT
          Win32 constant
static int GDI_ERROR
          Win32 constant
static long MERGECOPY
          Win32 constant
static long MERGEPAINT
          Win32 constant
static long NOTSRCCOPY
          Win32 constant
static long NOTSRCERASE
          Win32 constant
static int OPAQUE
          Win32 constant
static long PATCOPY
          Win32 constant
static long PATINVERT
          Win32 constant
static long PATPAINT
          Win32 constant
static long SRCAND
          Win32 constant
static long SRCCOPY
          Win32 constant
static long SRCERASE
          Win32 constant
static long SRCINVERT
          Win32 constant
static long SRCPAINT
          Win32 constant
static int TA_BASELINE
          Win32 constant
static int TA_BOTTOM
          Win32 constant
static int TA_CENTER
          Win32 constant
static int TA_LEFT
          Win32 constant
static int TA_NOUPDATECP
          Win32 constant
static int TA_RIGHT
          Win32 constant
static int TA_TOP
          Win32 constant
static int TA_UPDATECP
          Win32 constant
static int TRANSPARENT
          Win32 constant
static long WHITENESS
          Win32 constant
 
Constructor Summary
protected HDC(long handle)
          Wrap a HDC around a native hdc handle.
protected HDC(long handle, boolean temporary)
          Wrap an HDC around a native hdc handle.
 
Method Summary
 void bitBlt(int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, long dwRop)
          Call Win32 BitBlt.
static HDC createCompatibleDC(HDC hdc)
          Call Win32 CreateCompatibleDC
static HDC createDC(String driver, String device, String output, DEVMODE devmode)
          Call Win32 CreateDC.
 void deleteDC()
          Call Win32 DeleteDC
 void getTextExtentPoint32(byte[] text, int len, SIZE size)
          Call Win32 GetTextExtendPoint32A
 void getTextExtentPoint32(byte[] text, SIZE size)
          Call Win32 GetTextExtendPoint32A using text.length as len parameter.
 void getTextExtentPoint32(String text, int len, SIZE size)
          Call Win32 GetTextExtendPoint32W
 void getTextExtentPoint32(String text, SIZE size)
          Call Win32 GetTextExtentPoint32W using text.length() for the len parameter.
 void getTextMetrics(TEXTMETRIC metric)
          Call Win32 GetTextMetrics
 boolean isNeedsDelete()
           
 boolean isNeedsRelease()
           
 void lineTo(int x, int y)
          Call Win32 LineTo.
 void moveTo(int x, int y)
          Call Win32 MoveTo.
 void moveTo(int x, int y, POINT out_old_position)
          Call Win32 MoveTo.
 HBITMAP selectObject(HBITMAP hbitmap)
          Call Win32 SelectObject.
 HFONT selectObject(HFONT hfont)
          Select hfont into this DC.
 HPEN selectObject(HPEN hpen)
          Call Win32 SelectObject.
 int setBkColor(int colorref)
          Call Win32 SetBkColor.
 int setBkMode(int iBkMode)
          Call Win32 SetBkMode.
 int setTextAlign(int fMode)
          Call Win32 SetTextAlign.
 int setTextColor(int colorref)
          Call Win32 SetTextColor.
 void textOut(int xstart, int ystart, byte[] s)
          Call Win32 TextOutA
 void textOut(int xstart, int ystart, byte[] s, int len)
          Call Win32 TextOutA
 void textOut(int xstart, int ystart, String s)
          Call Win32 TextOutW
 void textOut(int xstart, int ystart, String s, int len)
          Call Win32 TextOutW
 
Methods inherited from class com.moesol.bindings.platform_sdk.windows_api.HANDLE
_getHandle, _safeGetHandle, detach, equals, getLeakCount, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SRCCOPY

public static final long SRCCOPY
Win32 constant

See Also:
Constant Field Values

SRCPAINT

public static final long SRCPAINT
Win32 constant

See Also:
Constant Field Values

SRCAND

public static final long SRCAND
Win32 constant

See Also:
Constant Field Values

SRCINVERT

public static final long SRCINVERT
Win32 constant

See Also:
Constant Field Values

SRCERASE

public static final long SRCERASE
Win32 constant

See Also:
Constant Field Values

NOTSRCCOPY

public static final long NOTSRCCOPY
Win32 constant

See Also:
Constant Field Values

NOTSRCERASE

public static final long NOTSRCERASE
Win32 constant

See Also:
Constant Field Values

MERGECOPY

public static final long MERGECOPY
Win32 constant

See Also:
Constant Field Values

MERGEPAINT

public static final long MERGEPAINT
Win32 constant

See Also:
Constant Field Values

PATCOPY

public static final long PATCOPY
Win32 constant

See Also:
Constant Field Values

PATPAINT

public static final long PATPAINT
Win32 constant

See Also:
Constant Field Values

PATINVERT

public static final long PATINVERT
Win32 constant

See Also:
Constant Field Values

DSTINVERT

public static final long DSTINVERT
Win32 constant

See Also:
Constant Field Values

BLACKNESS

public static final long BLACKNESS
Win32 constant

See Also:
Constant Field Values

WHITENESS

public static final long WHITENESS
Win32 constant

See Also:
Constant Field Values

CLR_INVALID

public static final int CLR_INVALID
Win32 constant

See Also:
Constant Field Values

GDI_ERROR

public static final int GDI_ERROR
Win32 constant

See Also:
Constant Field Values

TA_NOUPDATECP

public static final int TA_NOUPDATECP
Win32 constant

See Also:
Constant Field Values

TA_UPDATECP

public static final int TA_UPDATECP
Win32 constant

See Also:
Constant Field Values

TA_LEFT

public static final int TA_LEFT
Win32 constant

See Also:
Constant Field Values

TA_RIGHT

public static final int TA_RIGHT
Win32 constant

See Also:
Constant Field Values

TA_CENTER

public static final int TA_CENTER
Win32 constant

See Also:
Constant Field Values

TA_TOP

public static final int TA_TOP
Win32 constant

See Also:
Constant Field Values

TA_BOTTOM

public static final int TA_BOTTOM
Win32 constant

See Also:
Constant Field Values

TA_BASELINE

public static final int TA_BASELINE
Win32 constant

See Also:
Constant Field Values

TRANSPARENT

public static final int TRANSPARENT
Win32 constant

See Also:
Constant Field Values

OPAQUE

public static final int OPAQUE
Win32 constant

See Also:
Constant Field Values
Constructor Detail

HDC

protected HDC(long handle,
              boolean temporary)
Wrap an HDC around a native hdc handle. If temporary is true then do not check to see if this HDC has been deleted after it has been gc'ed.

Parameters:
handle -
temporary -

HDC

protected HDC(long handle)
Wrap a HDC around a native hdc handle.

Parameters:
handle -
Method Detail

createDC

public static HDC createDC(String driver,
                           String device,
                           String output,
                           DEVMODE devmode)
Call Win32 CreateDC.

Parameters:
driver -
device -
output -
devmode - - must be null (not implemented).
Returns:
a new HDC

createCompatibleDC

public static HDC createCompatibleDC(HDC hdc)
Call Win32 CreateCompatibleDC

Parameters:
hdc -
Returns:
an HDC that is compatible with @{code hdc}.

deleteDC

public void deleteDC()
Call Win32 DeleteDC


getTextMetrics

public void getTextMetrics(TEXTMETRIC metric)
Call Win32 GetTextMetrics

Parameters:
metric -

getTextExtentPoint32

public void getTextExtentPoint32(String text,
                                 SIZE size)
Call Win32 GetTextExtentPoint32W using text.length() for the len parameter.

Parameters:
text -
size -

getTextExtentPoint32

public void getTextExtentPoint32(String text,
                                 int len,
                                 SIZE size)
Call Win32 GetTextExtendPoint32W

Parameters:
text -
len -
size -

getTextExtentPoint32

public void getTextExtentPoint32(byte[] text,
                                 SIZE size)
Call Win32 GetTextExtendPoint32A using text.length as len parameter.

Parameters:
text -
size -

getTextExtentPoint32

public void getTextExtentPoint32(byte[] text,
                                 int len,
                                 SIZE size)
Call Win32 GetTextExtendPoint32A

Parameters:
text -
len -
size -

setBkColor

public int setBkColor(int colorref)
Call Win32 SetBkColor.

Parameters:
colorref -
Returns:

setBkMode

public int setBkMode(int iBkMode)
Call Win32 SetBkMode.

Parameters:
iBkMode -
Returns:

setTextColor

public int setTextColor(int colorref)
Call Win32 SetTextColor.

Parameters:
colorref -
Returns:

setTextAlign

public int setTextAlign(int fMode)
Call Win32 SetTextAlign.

Parameters:
fMode -
Returns:

selectObject

public HBITMAP selectObject(HBITMAP hbitmap)
Call Win32 SelectObject.

Parameters:
hbitmap -
Returns:
the HBITMAP that was previously selected.

selectObject

public HPEN selectObject(HPEN hpen)
Call Win32 SelectObject.

Parameters:
hpen -
Returns:
the HPEN what was previously selected.

selectObject

public HFONT selectObject(HFONT hfont)
Select hfont into this DC. The returned HFONT should be re-selected when the drawing operation using hfont is complete. The returned HFONT is marked as temporary and will not be reported if leaked.

Parameters:
hfont -
Returns:
the HFONT that was previously selected.

moveTo

public void moveTo(int x,
                   int y)
Call Win32 MoveTo.

Parameters:
x -
y -

moveTo

public void moveTo(int x,
                   int y,
                   POINT out_old_position)
Call Win32 MoveTo.

Parameters:
x -
y -
out_old_position -

lineTo

public void lineTo(int x,
                   int y)
Call Win32 LineTo.

Parameters:
x -
y -

textOut

public void textOut(int xstart,
                    int ystart,
                    String s)
Call Win32 TextOutW

Parameters:
xstart -
ystart -
s -

textOut

public void textOut(int xstart,
                    int ystart,
                    String s,
                    int len)
Call Win32 TextOutW

Parameters:
xstart -
ystart -
s -
len -

textOut

public void textOut(int xstart,
                    int ystart,
                    byte[] s)
Call Win32 TextOutA

Parameters:
xstart -
ystart -
s -

textOut

public void textOut(int xstart,
                    int ystart,
                    byte[] s,
                    int len)
Call Win32 TextOutA

Parameters:
xstart -
ystart -
s -
len -

bitBlt

public void bitBlt(int nXDest,
                   int nYDest,
                   int nWidth,
                   int nHeight,
                   HDC hdcSrc,
                   int nXSrc,
                   int nYSrc,
                   long dwRop)
Call Win32 BitBlt.

Parameters:
nXDest -
nYDest -
nWidth -
nHeight -
hdcSrc -
nXSrc -
nYSrc -
dwRop -

isNeedsDelete

public boolean isNeedsDelete()
Returns:
true if this HDC needs to be deleted.

isNeedsRelease

public boolean isNeedsRelease()
Returns:
true if this HDC needs to be released.


Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.