OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TWindowDC Class Reference

Derived from TDC, TWindowDC is a device context (DC) class that provides access to the entire area owned by a window. More...

#include <owl/dc.h>

Inheritance diagram for owl::TWindowDC:
owl::TDC owl::TGdiBase owl::TClientDC owl::TDesktopDC owl::TNCPaintDC owl::TScreenDC ocf::TOleClientDC

Public Member Functions

 TWindowDC (HWND wnd)
 Creates a TWindow object with the given owned window.
 
 ~TWindowDC ()
 
- Public Member Functions inherited from owl::TDC
 TDC (HDC handle)
 use an existing DC, doesn't auto delete it
 
 TDC ()
 for derived classes only
 
virtual ~TDC ()
 Default dtor does not delete Handle Calls RestoreObjects.
 
 operator HDC () const
 Must assume const is OK.
 
bool IsDC () const
 Validation routine - used mainly for diagnostic purposes.
 
void SetDC (HDC hdc)
 
bool GetDCOrg (TPoint &point) const
 Obtains the final translation origin for this device context and places the value in point.
 
virtual int SaveDC () const
 Saves the current state of this DC on a context stack.
 
virtual bool RestoreDC (int savedDC=-1)
 Restores the given savedDC.
 
virtual int GetDeviceCaps (int index) const
 Used under WIN3.1 or later, GetDeviceCaps returns capability information about this DC.
 
virtual bool ResetDC (const DEVMODE &devMode)
 Updates this DC using data in the given devMode structure.
 
void SelectObject (const TBrush &brush)
 Selects the given GDI brush object into this DC.
 
void SelectObject (const TPen &pen)
 Selects the given GDI pen object into this DC.
 
virtual void SelectObject (const TFont &font)
 Selects the given GDI font object into this DC.
 
void SelectObject (const TPalette &palette, bool forceBackground=false)
 Selects the given GDI palette object into this DC.
 
void SelectObject (const TBitmap &bitmap)
 Selects the given GDI bitmap object into this DC.
 
virtual void SelectStockObject (int index)
 Selects into the DC a predefined stock pen, brush, font, or palette.
 
void RestoreBrush ()
 Restores the original GDI brush object to this DC.
 
void RestorePen ()
 Restores the original GDI pen object to this DC.
 
virtual void RestoreFont ()
 Restores the original GDI font object to this DC.
 
void RestorePalette ()
 Restores the original GDI palette object to this DC.
 
void RestoreBitmap ()
 Restores the original GDI bitmap object into this DC.
 
void RestoreTextBrush ()
 Restores the original GDI text brush object to this DC.
 
void RestoreObjects ()
 Restores all the original GDI objects to this DC.
 
HANDLE GetCurrentObject (uint objectType) const
 Returns a handle to the currently selected object of the given objectType associated with this DC.
 
bool GetBrushOrg (TPoint &point) const
 Places in point the current brush origin of this DC.
 
bool SetBrushOrg (const TPoint &origin, TPoint *oldOrg=nullptr)
 Sets the origin of the currently selected brush of this DC with the given origin value.
 
int EnumObjects (uint objectType, GOBJENUMPROC proc, void *data) const
 Enumerates the pen or brush objects available for this DC.
 
TColor GetNearestColor (const TColor &color) const
 Returns the color nearest to the given Color argument for the current palette of this DC.
 
int RealizePalette ()
 Maps to the system palette the logical palette entries selected into this DC.
 
void UpdateColors ()
 Updates the client area of this DC by matching the current colors in the client area to the system palette on a pixel-by-pixel basis.
 
uint GetSystemPaletteEntries (int start, int num, PALETTEENTRY *entries) const
 Retrieves a range of up to num palette entries, starting at start, from the system palette to the entries array of PALETTEENTRY structures.
 
uint GetSystemPaletteUse () const
 Determines whether this DC has access to the full system palette.
 
int SetSystemPaletteUse (int usage)
 Changes the usage of this DC's system palette.
 
TColor GetBkColor () const
 Returns the current background color of this DC.
 
virtual TColor SetBkColor (const TColor &color)
 Sets the current background color of this DC to the given color value or the nearest available.
 
int GetBkMode () const
 Returns the background mode of this DC, either OPAQUE or TRANSPARENT.
 
int SetBkMode (int mode)
 Sets the background mode to the given mode argument, which can be either OPAQUE or TRANSPARENT.
 
int GetPolyFillMode () const
 Returns the current polygon-filling mode for this DC, either ALTERNATE or WINDING.
 
int SetPolyFillMode (int mode)
 Description Sets the polygon-filling mode for this DC to the given mode value, either ALTERNATE or WINDING.
 
int GetROP2 () const
 Returns the current drawing (raster operation) mode of this DC.
 
int SetROP2 (int mode)
 Sets the current foreground mix mode mode of this DC to the given mode value and returns the previous mode.
 
int GetStretchBltMode () const
 Returns the current stretching mode for this DC: BLACKONWHITE, COLORONCOLOR, or WHITEONBLACK.
 
int SetStretchBltMode (int mode)
 Sets the stretching mode of this DC to the given mode value and returns the previous mode.
 
TColor GetTextColor () const
 Returns the current text color of this DC.
 
virtual TColor SetTextColor (const TColor &color)
 Sets the current text color of this DC to the given color value.
 
bool SetMiterLimit (float newLimit, float *oldLimit=nullptr)
 Sets the limit of miter joins to newLimit and puts the previous value in oldLimit.
 
int GetMapMode () const
 If successful, returns the current window mapping mode of this DC; otherwise, returns 0.
 
virtual int SetMapMode (int mode)
 Sets the current window mapping mode of this DC to mode.
 
bool SetWorldTransform (XFORM &xform)
 Sets a two-dimensional linear transformation, given by the xform structure, between world space and page space for this DC.
 
bool ModifyWorldTransform (XFORM &xform, uint32 mode)
 Changes the current world transformation for this DC using the given xform and mode arguments.
 
bool GetViewportOrg (TPoint &point) const
 The first version sets in the point argument the x- and y-extents (in device-units) of this DC's viewport.
 
TPoint GetViewportOrg () const
 The first version sets in the point argument the x- and y-extents (in device-units) of this DC's viewport.
 
virtual bool SetViewportOrg (const TPoint &origin, TPoint *oldOrg=nullptr)
 Sets this DC's viewport origin to the given origin value, and saves the previous origin in oldOrg.
 
virtual bool OffsetViewportOrg (const TPoint &delta, TPoint *oldOrg=nullptr)
 Modifies this DC's viewport origin relative to the current values.
 
bool GetViewportExt (TSize &extent) const
 The first version retrieves this DC's current viewport's x- and y-extents (in device units) and places the values in extent.
 
TSize GetViewportExt () const
 The first version retrieves this DC's current viewport's x- and y-extents (in device units) and places the values in extent.
 
virtual bool SetViewportExt (const TSize &extent, TSize *oldExtent=nullptr)
 Sets this DC's viewport x- and y-extents to the given extent values.
 
virtual bool ScaleViewportExt (int xNum, int xDenom, int yNum, int yDenom, TSize *oldExtent=nullptr)
 Modifies this DC's viewport extents relative to the current values.
 
bool GetWindowOrg (TPoint &point) const
 Places in point the x- and y-coordinates of the origin of the window associated with this DC.
 
TPoint GetWindowOrg () const
 Places in point the x- and y-coordinates of the origin of the window associated with this DC.
 
bool SetWindowOrg (const TPoint &origin, TPoint *oldOrg=nullptr)
 Sets the origin of the window associated with this DC to the given origin value, and saves the previous origin in oldOrg.
 
bool OffsetWindowOrg (const TPoint &delta, TPoint *oldOrg=nullptr)
 Modifies this DC's window origin relative to the current values.
 
bool GetWindowExt (TSize &extent) const
 Retrieves this DC's window current x- and y-extents (in device units).
 
TSize GetWindowExt () const
 Retrieves this DC's window current x- and y-extents (in device units).
 
virtual bool SetWindowExt (const TSize &extent, TSize *oldExtent=nullptr)
 Sets this DC's window x- and y-extents to the given extent values.
 
virtual bool ScaleWindowExt (int xNum, int xDenom, int yNum, int yDenom, TSize *oldExtent=nullptr)
 Modifies this DC's window extents relative to the current values.
 
bool DPtoLP (TPoint *points, int count=1) const
 Converts each of the count points in the points array from device points to logical points.
 
bool DPtoLP (TRect &rect) const
 
bool LPtoDP (TPoint *points, int count=1) const
 Converts each of the count points in the points array from logical points to device points.
 
bool LPtoDP (TRect &rect) const
 Converts each of the count points in the points array from logical points to device points.
 
int GetClipBox (TRect &rect) const
 Places the current clip box size of this DC in rect.
 
TRect GetClipBox () const
 Places the current clip box size of this DC in rect.
 
int ExcludeClipRect (const TRect &rect)
 Creates a new clipping region for this DC.
 
int ExcludeUpdateRgn (HWND wnd)
 Prevents drawing within invalid areas of a window by excluding an updated region of this DC's window from its clipping region.
 
int IntersectClipRect (const TRect &rect)
 Creates a new clipping region for this DC's window by forming the intersection of the current region with the rectangle specified by rect.
 
int OffsetClipRgn (const TPoint &delta)
 Moves the clipping region of this DC by the x- and y-offsets specified in delta.
 
int SelectClipRgn (const TRegion &region)
 Selects the given region as the current clipping region for this DC.
 
int SelectClipRgn (HRGN r=0)
 Selects the given region as the current clipping region for the device context.
 
int RemoveClipRgn ()
 Removes the device context's clipping region.
 
bool PtVisible (const TPoint &point) const
 Returns true if the given point lies within the clipping region of this DC; otherwise, returns false.
 
bool RectVisible (const TRect &rect) const
 Returns true if any part of the given rectangle, rect, lies within the clipping region of this DC; otherwise, returns false.
 
bool GetBoundsRect (TRect &bounds, uint16 flags) const
 Reports in bounds the current accumulated bounding rectangle of this DC or of the Windows manager, depending on the value of flags.
 
uint SetBoundsRect (TRect &bounds, uint flags)
 Controls the accumulation of bounding rectangle information for this DC.
 
int GetClipRgn (TRegion &region) const
 Retrieves this DC's current clip-region and, if successful, places a copy of it in the region argument.
 
int EnumMetaFile (const TMetaFilePict &metaFile, MFENUMPROC callback, void *data) const
 Enumerates the GDI calls within the given metaFile.
 
bool PlayMetaFile (const TMetaFilePict &metaFile)
 Plays the contents of the given metaFile on this DC.
 
void PlayMetaFileRecord (HANDLETABLE &handletable, METARECORD &metaRecord, int count)
 Plays the metafile record given in metaRecord to this DC by executing the GDI function call contained in that record.
 
int EnumEnhMetaFile (const TEnhMetaFilePict &metaFile, ENHMFENUMPROC callback, void *data, const TRect *rect) const
 Enumerate through the enhanced metafile records.
 
bool PlayEnhMetaFile (const TEnhMetaFilePict &metaFile, const TRect *rect)
 Play the enhanced metafile onto this device context.
 
void PlayEnhMetaFileRecord (HANDLETABLE &handletable, ENHMETARECORD &metaRecord, uint count)
 Play one record from the enhanced metafile onto this DC.
 
bool GetCurrentPosition (TPoint &point) const
 Reports in point the logical coordinates of this DC's current position.
 
bool MoveTo (int x, int y)
 Moves the current position of this DC to the given x- and y-coordinates or to the given point.
 
bool MoveTo (const TPoint &point)
 Moves the current position of this DC to the given x- and y-coordinates or to the given point.
 
bool MoveTo (const TPoint &point, TPoint &oldPoint)
 Moves the current position of this DC to the given x- and y-coordinates or to the given point.
 
bool DrawIcon (int x, int y, const TIcon &icon)
 Draws the given icon on this DC.
 
bool DrawIcon (const TPoint &point, const TIcon &icon)
 Draws the given icon on this DC.
 
bool DrawCursor (int x, int y, const TCursor &cursor)
 
bool DrawCursor (const TPoint &point, const TCursor &cursor)
 
bool DrawIcon (int x, int y, const TIcon &icon, int w, int h, int aniStep=0, HBRUSH bkBr=0, uint flags=DI_NORMAL)
 
bool DrawIcon (const TPoint &point, const TIcon &icon, const TSize &size, int aniStep=0, HBRUSH bkBr=0, uint flags=DI_NORMAL)
 
bool DrawCursor (int x, int y, const TCursor &cursor, int w, int h, int aniStep=0, HBRUSH bkBr=0, uint flags=DI_NORMAL)
 
bool DrawCursor (const TPoint &point, const TCursor &cursor, const TSize &size, int aniStep=0, HBRUSH bkBr=0, uint flags=DI_NORMAL)
 
bool FrameRect (int x1, int y1, int x2, int y2, const TBrush &brush)
 Draws a border on this DC around the given rectangle, rect, using the given brush, brush.
 
bool FrameRect (const TRect &rect, const TBrush &brush)
 Draws a border on this DC around the given rectangle, rect, using the given brush, brush.
 
bool FillRect (int x1, int y1, int x2, int y2, const TBrush &brush)
 Fills the given rectangle on this DC using the specified brush.
 
bool FillRect (const TRect &rect, const TBrush &brush)
 Fills the given rectangle on this DC using the specified brush.
 
bool InvertRect (int x1, int y1, int x2, int y2)
 Inverts the given rectangle, rect, on this DC.
 
bool InvertRect (const TRect &rect)
 Inverts the given rectangle, rect, on this DC.
 
bool DrawFocusRect (int x1, int y1, int x2, int y2)
 Draws the given rectangle on this DC in the style used to indicate focus.
 
bool DrawFocusRect (const TRect &rect)
 Draws the given rectangle on this DC in the style used to indicate focus.
 
bool DrawEdge (const TRect &frame, uint edge, uint flags)
 
void PaintFrame (const TRect &fr, uint flags, const TColor &tlColor, const TColor &brColor)
 
bool TextRect (int x1, int y1, int x2, int y2)
 Fills the given rectangle, clipping any text to the rectangle.
 
bool TextRect (const TRect &rect)
 Fills the given rectangle, clipping any text to the rectangle.
 
bool TextRect (int x1, int y1, int x2, int y2, const TColor &color)
 Fills the given rectangle, clipping any text to the rectangle.
 
bool TextRect (const TRect &rect, const TColor &color)
 Fills the given rectangle, clipping any text to the rectangle.
 
bool FillSolidRect (const TRect &r, const TColor &color)
 
void OWLFastWindowFrame (TBrush &brush, TRect &r, int xWidth, int yWidth, uint32 rop=PATCOPY)
 Draws a frame of the specified size and thickness with the given brush.
 
bool FrameRgn (const TRegion &region, const TBrush &brush, const TSize &brushSize)
 Draws a border on this DC around the given region, region, using the given brush, brush.
 
bool FillRgn (const TRegion &region, const TBrush &brush)
 Fills the given region on this DC using the specified brush.
 
bool InvertRgn (const TRegion &region)
 Inverts the given region, on this DC.
 
bool PaintRgn (const TRegion &region)
 Paints the given rectangle using the currently selected brush for this DC.
 
bool AngleArc (int x, int y, uint32 radius, float startAngle, float sweepAngle)
 Draws a line segment and an arc on this DC using the currently selected pen object.
 
bool AngleArc (const TPoint &center, uint32 radius, float startAngle, float sweepAngle)
 Draws a line segment and an arc on this DC using the currently selected pen object.
 
bool Arc (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
 Draws an elliptical arc on this DC using the currently selected pen object.
 
bool Arc (const TRect &r, const TPoint &start, const TPoint &end)
 Draws an elliptical arc on this DC using the currently selected pen object.
 
bool Chord (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
 Draws and fills a chord (a region bounded by the intersection of an ellipse and a line segment) on this DC using the currently selected pen and brush objects.
 
bool Chord (const TRect &R, const TPoint &Start, const TPoint &End)
 Draws and fills a chord (a region bounded by the intersection of an ellipse and a line segment) on this DC using the currently selected pen and brush objects.
 
bool Pie (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
 Using the currently selected pen and brush objects, draws and fills a pie-shaped wedge by drawing an elliptical arc whose center and end points are joined by lines.
 
bool Pie (const TRect &rect, const TPoint &start, const TPoint &end)
 Using the currently selected pen and brush objects, draws and fills a pie-shaped wedge by drawing an elliptical arc whose center and end points are joined by lines.
 
bool Ellipse (int x1, int y1, int x2, int y2)
 Draws and fills an ellipse on this DC using the currently selected pen and brush objects.
 
bool Ellipse (const TPoint &p1, const TPoint &p2)
 Draws and fills an ellipse on this DC using the currently selected pen and brush objects.
 
bool Ellipse (const TPoint &point, const TSize &size)
 Draws and fills an ellipse on this DC using the currently selected pen and brush objects.
 
bool Ellipse (const TRect &rect)
 Draws and fills an ellipse on this DC using the currently selected pen and brush objects.
 
bool LineTo (int x, int y)
 Draws a line on this DC using the current pen object.
 
bool LineTo (const TPoint &point)
 Draws a line on this DC using the current pen object.
 
bool Polyline (const TPoint *points, int count)
 Using the current pen object, draws on this DC a count of line segments (there must be at least 2).
 
bool Polygon (const TPoint *points, int count)
 
bool PolyPolygon (const TPoint *points, const int *PolyCounts, int count)
 Using the current pen and polygon-filling mode, draws and fills on this DC the number of closed polygons indicated in count (which must be >= 2).
 
bool PolyPolyline (const TPoint *points, const int *PolyCounts, int count)
 Using the currently selected pen object, draws on this DC the number of polylines (connected line segments) indicated in count.
 
bool PolyBezier (const TPoint *points, int count)
 Draws one or more connected cubic Bezier splines through the points specified in the points array using the currently selected pen object.
 
bool PolyBezierTo (const TPoint *points, int count)
 Draws one or more connected cubic Beziers splines through the points specified in the points array using the currently selected pen object.
 
bool PolyDraw (const TPoint *points, uint8 *types, int count)
 Using the currently selected pen object, draws one or more possibly disjoint sets of line segments or Bezier splines or both on this DC.
 
bool PolylineTo (const TPoint *points, int count)
 Draws one or more connected line segments on this DC using the currently selected pen object.
 
bool Rectangle (int x1, int y1, int x2, int y2)
 Draws and fills a rectangle of the given size on this DC with the current pen and brush objects.
 
bool Rectangle (const TPoint &p1, const TPoint &p2)
 Draws and fills a rectangle of the given size on this DC with the current pen and brush objects.
 
bool Rectangle (const TPoint &point, const TSize &s)
 Draws and fills a rectangle of the given size on this DC with the current pen and brush objects.
 
bool Rectangle (const TRect &rect)
 Draws and fills a rectangle of the given size on this DC with the current pen and brush objects.
 
bool RoundRect (int x1, int y1, int x2, int y2, int x3, int y3)
 Draws and fills a rounded rectangle of the given size on this DC with the current pen and brush objects.
 
bool RoundRect (const TPoint &p1, const TPoint &p2, const TPoint &rad)
 Draws and fills a rounded rectangle of the given size on this DC with the current pen and brush objects.
 
bool RoundRect (const TPoint &p, const TSize &s, const TPoint &rad)
 Draws and fills a rounded rectangle of the given size on this DC with the current pen and brush objects.
 
bool RoundRect (const TRect &rect, const TPoint &rad)
 Draws and fills a rounded rectangle of the given size on this DC with the current pen and brush objects.
 
TColor GetPixel (int x, int y) const
 Returns the color of the pixel at the given location.
 
TColor GetPixel (const TPoint &point) const
 Returns the color of the pixel at the given location.
 
TColor SetPixel (int x, int y, const TColor &color)
 Sets the color of the pixel at the given location to the given color and returns the pixel's previous color.
 
TColor SetPixel (const TPoint &p, const TColor &color)
 Sets the color of the pixel at the given location to the given color and returns the pixel's previous color.
 
bool BitBlt (int dstX, int dstY, int w, int h, const TDC &srcDC, int srcX, int srcY, uint32 rop=SRCCOPY)
 Performs a bit-block transfer from srcDc (the given source DC) to this DC (the destination DC).
 
bool BitBlt (const TRect &dst, const TDC &srcDC, const TPoint &src, uint32 rop=SRCCOPY)
 Performs a bit-block transfer from srcDc (the given source DC) to this DC (the destination DC).
 
bool PatBlt (int x, int y, int w, int h, uint32 rop=PATCOPY)
 
bool PatBlt (const TRect &dst, uint32 rop=PATCOPY)
 
bool ScrollDC (int x, int y, const TRect &scroll, const TRect &clip, TRegion &updateRgn, TRect &updateRect)
 Scrolls a rectangle of bits horizontally by x (or delta.x in the second version) device-units, and vertically by y (or delta.y) device-units on this DC.
 
bool ScrollDC (const TPoint &delta, const TRect &scroll, const TRect &clip, TRegion &updateRgn, TRect &updateRect)
 Scrolls a rectangle of bits horizontally by x (or delta.x in the second version) device-units, and vertically by y (or delta.y) device-units on this DC.
 
bool StretchBlt (int dstX, int dstY, int dstW, int dstH, const TDC &srcDC, int srcX, int srcY, int srcW, int srcH, uint32 rop=SRCCOPY)
 Copies a bitmap from the source DC to a destination rectangle on this DC specified either by upper left-corner coordinates (dstX, dstY), width dstW, and height dstH, or (in the second version) by a TRect object, dst.
 
bool StretchBlt (const TRect &dst, const TDC &srcDC, const TRect &src, uint32 rop=SRCCOPY)
 Copies a bitmap from the source DC to a destination rectangle on this DC specified either by upper left-corner coordinates (dstX, dstY), width dstW, and height dstH, or (in the second version) by a TRect object, dst.
 
bool MaskBlt (const TRect &dst, const TDC &srcDC, const TPoint &src, const TBitmap &maskBm, const TPoint &maskPos, uint32 rop=SRCCOPY)
 Copies a bitmap from the given source DC to this DC.
 
bool PlgBlt (const TPoint *points, const TDC &srcDC, const TRect &src, const TBitmap &maskBm, const TPoint &maskPos)
 Performs a bit-block transfer from the given source DC to this DC.
 
bool TransparentBlt (const TRect &dst, const TDC &srcDC, const TRect &src, const TColor &transparent)
 Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.
 
int GetDIBits (const TBitmap &bitmap, uint startScan, uint numScans, void *bits, const BITMAPINFO &info, uint16 usage)
 The first version retrieves some or all of the bits from the given bitmap on this DC and copies them to the bits buffer using the DIB (device-independent bitmap) format specified by the BITMAPINFO argument, info.
 
int GetDIBits (const TBitmap &bitmap, TDib &dib)
 The first version retrieves some or all of the bits from the given bitmap on this DC and copies them to the bits buffer using the DIB (device-independent bitmap) format specified by the BITMAPINFO argument, info.
 
int SetDIBits (TBitmap &bitmap, uint startScan, uint numScans, const void *bits, const BITMAPINFO &Info, uint16 usage)
 The first version sets the pixels in bitmap (the given destination bitmap on this DC) from the source DIB (device-independent bitmap) color data found in the byte array bits and the BITMAPINFO structure, Info.
 
int SetDIBits (TBitmap &bitmap, const TDib &dib)
 The first version sets the pixels in bitmap (the given destination bitmap on this DC) from the source DIB (device-independent bitmap) color data found in the byte array bits and the BITMAPINFO structure, Info.
 
int SetDIBitsToDevice (const TRect &dst, const TPoint &src, uint startScan, uint numScans, const void *bits, const BITMAPINFO &bitsInfo, uint16 usage)
 The first version sets the pixels in dst (the given destination rectangle on this DC) from the source DIB (device-independent bitmap) color data found in the byte array bits and the BITMAPINFO structure, bitsInfo.
 
int SetDIBitsToDevice (const TRect &dst, const TPoint &src, const TDib &dib)
 The first version sets the pixels in dst (the given destination rectangle on this DC) from the source DIB (device-independent bitmap) color data found in the byte array bits and the BITMAPINFO structure, bitsInfo.
 
int StretchDIBits (const TRect &dst, const TRect &src, const void *bits, const BITMAPINFO &bitsInfo, uint16 usage, uint32 rop=SRCCOPY)
 Copies the color data from src, the source rectangle of pixels in the given DIB (device-independent bitmap) on this DC, to dst, the destination rectangle.
 
int StretchDIBits (const TRect &dst, const TRect &src, const TDib &dib, uint32 rop=SRCCOPY)
 Copies the color data from src, the source rectangle of pixels in the given DIB (device-independent bitmap) on this DC, to dst, the destination rectangle.
 
HBITMAP CreateDIBSection (const BITMAPINFO &info, uint usage, void **bits, HANDLE section=0, uint32 offset=0)
 Create a fast DIB under Win32.
 
bool FloodFill (const TPoint &point, const TColor &color)
 Fills an area on this DC starting at point and using the currently selected brush object.
 
bool ExtFloodFill (const TPoint &point, const TColor &color, uint16 fillType)
 Fills an area on this DC starting at point and using the currently selected brush object.
 
virtual bool TextOut (int x, int y, const tstring &str, int count=-1)
 Draws up to count characters of the given null-terminated string in the current font on this DC.
 
bool TextOut (const TPoint &p, const tstring &str, int count=-1)
 Draws up to count characters of the given null-terminated string in the current font on this DC.
 
virtual bool ExtTextOut (int x, int y, uint16 options, const TRect *r, const tstring &str, int count=-1, const int *dx=nullptr)
 Draws up to count characters of the given null-terminated string in the current font on this DC.
 
bool ExtTextOut (const TPoint &p, uint16 options, const TRect *r, const tstring &str, int count=-1, const int *dx=nullptr)
 Draws up to count characters of the given null-terminated string in the current font on this DC.
 
virtual bool TabbedTextOut (const TPoint &p, const tstring &str, int count, int numPositions, const int *positions, int tabOrigin, TSize &size)
 Draws up to count characters of the given null-terminated string in the current font on this DC.
 
bool TabbedTextOut (const TPoint &p, const tstring &str, int count, int numPositions, const int *positions, int tabOrigin)
 Draws up to count characters of the given null-terminated string in the current font on this DC.
 
int DrawText (const tstring &str, int count, const TRect &, uint16 format=0)
 Overload for const TRect& For obvious reasons, this overload does not support the DT_CALCRECT format flag.
 
virtual int DrawText (const tstring &str, int count, TRect &, uint16 format=0)
 Formats and draws in the given rectangle, r, up to count characters of the null-terminated string using the current font for this DC.
 
virtual int DrawTextEx (TCHAR *str, int count, TRect *=nullptr, uint format=0, LPDRAWTEXTPARAMS=nullptr)
 Formats and draws in the given rectangle, r, up to count characters of the null-terminated string using the current font for this DC.
 
bool DrawFrameControl (TRect lpRect, UINT nType, UINT nState)
 
virtual bool GrayString (const TBrush &brush, GRAYSTRINGPROC outputFunc, const tstring &str, int count, const TRect &r)
 Draws in the given rectangle (r) up to count characters of gray text from string using the given brush, brush, and the current font for this DC.
 
bool GetTextExtent (const tstring &str, int stringLen, TSize &size) const
 Computes the extent (width and height) in logical units of the text line consisting of stringLen characters from the null-terminated string.
 
TSize GetTextExtent (const tstring &str, int stringLen) const
 Computes the extent (width and height) in logical units of the text line consisting of stringLen characters from the null-terminated string.
 
bool GetTabbedTextExtent (const tstring &str, int stringLen, int numPositions, const int *positions, TSize &size) const
 Computes the extent (width and height) in logical units of the text line consisting of stringLen characters from the null-terminated string.
 
TSize GetTabbedTextExtent (const tstring &str, int stringLen, int numPositions, const int *positions) const
 Computes the extent (width and height) in logical units of the text line consisting of stringLen characters from the null-terminated string.
 
uint GetTextAlign () const
 If successful, returns the current text-alignment flags for this DC; otherwise, returns the value GDI_ERROR.
 
uint SetTextAlign (uint flags)
 Sets the text-alignment flags for this DC.
 
int GetTextCharacterExtra () const
 If successful, returns the current intercharacter spacing, in logical units, for this DC; otherwise, returns INVALID_WIDTH.
 
int SetTextCharacterExtra (int extra)
 If successful, sets the current intercharacter spacing to extra, in logical units, for this DC, and returns the previous intercharacter spacing.
 
bool SetTextJustification (int breakExtra, int breakCount)
 When text strings are displayed using TDC::TextOut and TDC::ExtTextOut, sets the number of logical units specified in breakExtra as the total extra space to be added to the number of break characters specified in breakCount.
 
int GetTextFaceLength () const
 Retrieves the length of the typeface name for the current font on this DC.
 
int GetTextFace (int count, TCHAR *facename) const
 Retrieves the typeface name for the current font on this DC.
 
tstring GetTextFace () const
 
bool GetTextMetrics (TEXTMETRIC &metrics) const
 Fills the metrics structure with metrics data for the current font on this DC.
 
TEXTMETRIC GetTextMetrics () const
 Functional style overload.
 
uint32 GetGlyphOutline (uint chr, uint format, GLYPHMETRICS &gm, uint32 buffSize, void *buffer, const MAT2 &mat2)
 Retrieves TrueType metric and other data for the given character, chr, on this DC and places it in gm and buffer.
 
int GetKerningPairs (int pairs, KERNINGPAIR *krnPair)
 Retrieves kerning pairs for the current font of this DC up to the number specified in pairs and copies them into the krnPair array of KERNINGPAIR structures.
 
uint GetOutlineTextMetrics (uint data, OUTLINETEXTMETRIC &otm)
 Retrieves metric information for TrueType fonts on this DC and copies it to the given array of OUTLINETEXTMETRIC structures, otm.
 
bool GetCharWidth (uint firstChar, uint lastChar, int *buffer)
 Retrieves the widths in logical units for a consecutive sequence of characters in the current font for this DC.
 
uint32 SetMapperFlags (uint32 flag)
 Alters the algorithm used by the font mapper when mapping logical fonts to physical fonts on this DC.
 
bool GetAspectRatioFilter (TSize &size) const
 Retrieves the setting of the current aspect-ratio filter for this DC.
 
int EnumFonts (LPCTSTR faceName, OLDFONTENUMPROC callback, void *data) const
 Enumerates the fonts available on this DC for the given faceName.
 
int EnumFonts (const tstring &facename, OLDFONTENUMPROC callback, void *data) const
 
int EnumFontFamilies (LPCTSTR family, FONTENUMPROC proc, void *data) const
 Enumerates the fonts available to this DC in the font family specified by family.
 
int EnumFontFamilies (const tstring &family, FONTENUMPROC proc, void *data) const
 
uint32 GetFontData (uint32 table, uint32 offset, void *buffer, long data)
 Retrieves font-metric information from a scalable TrueType font file (specified by table and starting at offset into this table) and places it in the given buffer.
 
bool GetCharABCWidths (uint firstChar, uint lastChar, ABC *abc)
 Retrieves the widths of consecutive characters in the range firstChar to lastChar from the current TrueType font of this DC.
 
bool BeginPath ()
 Opens a new path bracket for this DC and discards any previous paths from this DC.
 
bool CloseFigure ()
 Closes an open figure in this DC's open path bracket by drawing a line from the current position to the first point of the figure (usually the point specified by the most recent TDC::MoveTo call), and connecting the lines using the current join style for this DC.
 
bool EndPath ()
 Closes the path bracket and selects the path it defines into this DC.
 
bool FlattenPath ()
 Transforms any curves in the currently selected path of this DC.
 
bool WidenPath ()
 Redefines the current, closed path on this DC as the area that would be painted if the path were stroked with this DC's current pen.
 
bool FillPath ()
 Closes any open figures in the current path of this DC and fills the path's interior using the current brush and polygon fill mode.
 
bool StrokePath ()
 Renders the current, closed path on this DC and uses the DC's current pen.
 
bool StrokeAndFillPath ()
 Closes any open figures in the current path of this DC, strokes the outline of the path using the current pen, and fills its interior using the current brush and polygon fill mode.
 
bool SelectClipPath (int mode)
 Selects the current path on this DC as a clipping region, combining any existing clipping region using the specified mode as shown in the following table:
 
HRGN PathToRegion ()
 If successful, returns a region created from the closed path in this DC; otherwise, returns 0.
 
virtual HDC GetAttributeHDC () const
 Returns the attributes of the DC object.
 
HDC GetHDC () const
 Return the handle of the device context.
 

Protected Member Functions

 TWindowDC ()
 Used for derived classes only.
 
- Protected Member Functions inherited from owl::TDC
 TDC (HDC handle, TAutoDelete autoDelete)
 Constructor for use by derived classes only.
 
void Init ()
 Sets OrgBrush, OrgPen, OrgFont, OrgBitmap, and OrgPalette to 0, and sets ShouldDelete to true.
 
void CheckValid (uint resId=IDS_GDIFAILURE)
 
- Protected Member Functions inherited from owl::TGdiBase
void CheckValid (uint resId=IDS_GDIFAILURE)
 
 TGdiBase ()
 This default constructor sets Handle to 0 and ShouldDelete to true.
 
 TGdiBase (HANDLE handle, TAutoDelete autoDelete=NoAutoDelete)
 Initializes members to given values, and validates the handle.
 

Protected Attributes

HWND Wnd
 Holds a handle to the window owned by this device context.
 
- Protected Attributes inherited from owl::TDC
HANDLE Handle
 < make this function available to derivatives
 
bool ShouldDelete
 < The handle of this DC. Uses the base class's handle (TGdiBase::Handle.)
 
- Protected Attributes inherited from owl::TGdiBase
HANDLE Handle
 GDI handle of this object.
 
bool ShouldDelete
 Should object delete GDI handle in dtor?
 

Additional Inherited Members

- Public Types inherited from owl::TDC
enum  TFlag {
  Left = 0x0001 , Top = 0x0002 , Right = 0x0004 , Bottom = 0x0008 , TopLeft = Top | Left , TopRight = Top | Right , BottomLeft = Bottom | Left , BottomRight = Bottom | Right , Rect = Top | Left | Bottom | Right , Diagonal = 0x0010 ,
  Fill = 0x0800 , Soft = 0x1000 , Adjust = 0x2000 , Flat = 0x4000 , Mono = 0x8000
}
 Which edge(s) to draw. ctor defaults to all 4. More...
 
enum  TStyle {
  None , Plain , Raised , Recessed , Embossed , Grooved , ButtonUp , ButtonDn , WndRaised , WndRecessed ,
  WellSet , ButtonUp3x , ButtonDn3x
}
 Enumeration describing hilevel border styles. More...
 
enum  TEdge { RaisedOuter = 0x01 , SunkenOuter = 0x02 , RaisedInner = 0x04 , SunkenInner = 0x08 , EdgeOuter = 0x03 , EdgeInner = 0x0C , EdgeRaised = RaisedOuter | RaisedInner , EdgeSunken = SunkenOuter | SunkenInner , EdgeEtched = SunkenOuter | RaisedInner , EdgeBump = RaisedOuter | SunkenInner }
 Enumeration describing the type of edge to be drawn. More...
 
- Static Protected Member Functions inherited from owl::TGdiBase
static void _CheckValid (HANDLE handle, uint resId=IDS_GDIFAILURE)
 

Detailed Description

Derived from TDC, TWindowDC is a device context (DC) class that provides access to the entire area owned by a window.

TWindowDC is the base class for any DC class that releases its handle when it is finished.

Definition at line 588 of file dc.h.

Constructor & Destructor Documentation

◆ TWindowDC() [1/2]

owl::TWindowDC::TWindowDC ( HWND hWnd)

Creates a TWindow object with the given owned window.

The data member Wnd is set to wnd.

Definition at line 29 of file windowdc.cpp.

References owl::TDC::CheckValid(), owl::TDC::Handle, and Wnd.

◆ ~TWindowDC()

owl::TWindowDC::~TWindowDC ( )

Definition at line 41 of file windowdc.cpp.

References owl::TDC::Handle, owl::TDC::RestoreObjects(), owl::TDC::ShouldDelete, and Wnd.

◆ TWindowDC() [2/2]

owl::TWindowDC::TWindowDC ( )
protected

Used for derived classes only.

Definition at line 19 of file windowdc.cpp.

Member Data Documentation

◆ Wnd

HWND owl::TWindowDC::Wnd
protected

Holds a handle to the window owned by this device context.

Definition at line 595 of file dc.h.


The documentation for this class was generated from the following files: