[TBD]
Common methods apply to most windows, controls and resources.
new(WINDOW | DRIVER, DEVICE)
Creates a new DC object; the first form (WINDOW is a Win32::GUI object) gets the DC for the specified window (can also be called as WINDOW->GetDC). The second form creates a DC for the specified DEVICE; actually, the only supported DRIVER is the display driver (eg. the screen). To get the DC for the entire screen use:
$Screen = new Win32::GUI::DC("DISPLAY");
See also the common options.
AbortPath()
Closes and discards any paths.
Arc(X, Y, RADIUS, START, SWEEP)
Draws a line segment and an arc. The line segment is drawn from the current position to the beginning of the arc. The arc is drawn along the perimeter of a circle with the given radius and center. The length of the arc is defined by the given start and sweep angles.
ArcDirection([DIRECTION])
Gets or sets the drawing direction to be used for arc and rectangle functions.
ArcTo(LEFT, TOP, RIGHT, BOTTOM, XRADIALF, YRADIALF, XRADIALS, YRADIALS)
Draws an elliptical arc.
BackColor([COLOR])
Gets or sets the background color.
BeginPath()
Opens a path bracket.
BitBlt(XD, YD, WD, HD, SOURCE, XS, YS, [ROP=SRCCOPY])
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.
BkMode([MODE])
Gets or sets the current background mix mode for the DC; possible values are:
1 TRANSPARENT 2 OPAQUE
CancelDC()
Cancels any pending operation on the device context.
Chord(LEFT, TOP, RIGHT, BOTTOM, XF, YF, XS, YS)
Draws a chord (a region bounded by the intersection of an ellipse and a line segment, called a "secant"). The chord is outlined by using the current pen and filled by using the current brush.
Circle(X, Y, (WIDTH, HEIGHT | RADIUS))
Draws a circle or an ellipse; X, Y, RADIUS specifies the center point and the radius of the circle, while X, Y, WIDTH, HEIGHT specifies the center point and the size of the ellipse. Returns nonzero if succesful, zero on errors.
CloseFigure()
Closes an open figure in a path.
CreateCompatibleBitmap(WIDTH, HEIGHT)
Creates a bitmap compatible with the device that is associated with the specified device context.
CreateCompatibleDC()
Creates a memory device context (DC) compatible with the specified device.
CreateDC(DRIVER, DEVICE)
Used by new Win32::GUI::DC. Creates a device context (DC) for a device by using the specified name.
DeleteDC(HANDLE)
Deletes the specified device context
DeleteObject(OBJECT)
Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object.
DrawEdge(LEFT, TOP, RIGHT, BOTTOM, [EDGE=EDGE_RAISE, [FLAGS=BF_RECT]])
Draws one or more edges of rectangle
DrawFocusRect(LEFT, TOP, RIGHT, BOTTOM)
Draws a rectangle in the style used to indicate that the rectangle has the focus.
DrawFrameControl(LEFT, TOP, RIGHT, BOTTOM, TYPE, STATE)
Draws a frame control of the specified type and style.
If STATE includes DFCS_ADJUSTRECT, then the input parameters LEFT, TOP, RIGHT, BOTTOM are ajusted to exclude the surrounding edge of the push button. If any of LEFT, TOP, RIGHT, BOTTOM are readonly, then DFCS_ADJUSTRECT will be ignored for the readonly parameters.
DrawIcon(Icon,X, Y)
The DrawIcon method draws an icon or cursor into the specified device context.
DrawText(STRING, LEFT, TOP, RIGHT, BOTTOM, [FORMAT=DT_LEFT|DT_SINGLELINE|DT_TOP])
Draws formatted text in the specified rectangle. It formats the text according to the specified method.
Ellipse(LEFT, TOP, RIGHT, BOTTOM)
Draws an ellipse. The center of the ellipse is the center of the specified bounding rectangle. The ellipse is outlined by using the current pen and is filled by using the current brush.
EndPath()
Closes a path bracket and selects the path defined by the bracket.
ExtFloodFill(X, Y, COLOR, [TYPE=FLOODFILLSURFACE])
Fills an area of the display surface with the current brush.
Fill(X, Y, [COLOR], [TYPE])
Fills an area of the display surface.
FillPath()
Closes any open figures in the current path and fills the path's interior by using the current brush and polygon-filling mode.
FillRect(LEFT, TOP, RIGHT, BOTTOM, BRUSH)
Fills a rectangle by using the specified brush. This includes the left and top borders, but excludes the right and bottom borders of the rectangle.
FillRgn(Region,Brush)
The FillRgn function fills a region by using the specified brush.
FlattenPath()
Transforms any curves in the path that is selected, turning each curve into a sequence of lines.
FloodFill(X, Y, COLOR)
Fills an area of the display surface with the current brush.
FrameRect(LEFT, TOP, RIGHT, BOTTOM, BRUSH)
Draws a border around the specified rectangle by using the specified brush. The width and height of the border are always one logical unit.
FrameRgn(Region,Brush,Width,Height)
The FrameRgn function draws a border around the specified region by using the specified brush.
The Width Specifies the width of vertical brush strokes. The Height Specifies the height of horizontal brush strokes.
GetBrushOrgEx(GetBrushOrgEx)
The GetBrushOrgEx method retrieves the current brush origin (x,y) for the specified device context.
GetCurrentObject(HANDLE,OBJECTTYPE)
Obtains a handle to a device context's currently selected object of a specified type.
GetDC(HANDLE)
Gets a handle to the DC associated with the given window (eg. gets an HDC from an HWND). Used by new Win32::GUI::DC
GetDeviceCaps(HANDLE,INDEX)
Retrieves device-specific information about a specified device.
GetMiterLimit()
Returns the miter limit for the specified device context.
GetObjectType(OBJECT)
Identifies the type of the specified object.
GetPixel(X, Y)
Returns the color of the pixel at X, Y.
GetStockObject(TYPEOBJECT)
Identifies the type of the specified object.
GetTextExtentPoint(STRING)
Computes the width and height of the specified string of text.
GetTextFace()
Retrieves the typeface name of the font that is selected into the specified device context.
GetUpdateRect([ERASE])
Returns the rectangle (as a four-element array containing left, top, right, bottom coordinates) that needs to be updated. If the update region is empty (eg. no need to update, the function returns undef). The optional ERASE parameter can be set to 1 to force an erase of the update region, if there is any; by default, no erase action is performed. This function is intended to be used in a Paint event; see Win32::GUI::Graphic::Paint().
InvertRect(LEFT, TOP, RIGHT, BOTTOM)
Inverts a rectangle in a window by performing a logical NOT operation on the color values for each pixel in the rectangle's interior.
InvertRgn(Region)
The InvertRgn function inverts the colors in the specified region.
Line(X,Y,X1,Y1)
A combination of MoveTo and LineTo
LineTo(X, Y)
Draws a line from the current drawing position up to, but not including, the point specified by X, Y. Returns nonzero if succesful, zero on errors.
MapMode([MODE])
[TBD]
MoveTo(X, Y)
Moves the current drawing position to the point specified by X, Y. Returns nonzero if succesful, zero on errors.
PaintDesktop()
Fills the DC content with the desktop pattern or wallpaper. Returns nonzero if succesful, zero on errors.
PaintRgn(Region)
The PaintRgn function paints the specified region by using the brush currently selected into the device context.
PathToRegion()
Creates a region from the path that is selected into the specified device context.
Pie(LEFT, TOP, RIGHT, BOTTOM, XF, YF, XS, YS)
Draws a pie-shaped wedge bounded by the intersection of an ellipse and two radials. The pie is outlined by using the current pen and filled by using the current brush.
PolyBezier(X1, Y1, X2, Y2, X3, Y3, X4, Y4, [ X, Y, ... ])
Draws one or more Bézier curves. The first curve is drawn from the first point to the fourth point by using the second and third points as control points. Each subsequent curve in the sequence needs exactly three more points: the ending point of the previous curve is used as the starting point, the next two points in the sequence are control points, and the third is the ending point.
PolyBezierTo(X1, Y1, X2, Y2, X3, Y3, [ X, Y, ... ])
Draws cubic Bézier curves. The first curve is drawn from the current position to the third point by using the first two points as control points. For each subsequent curve, the function needs exactly three more points, and uses the ending point of the previous curve as the starting point for the next.
Polygon(X1, Y1, X2, Y2, [ X, Y, ... ])
Draws a polygon consisting of two or more vertices connected by straight lines.
Polyline(X1, Y1, X2, Y2, [ X, Y, ... ])
Draws one or more straight lines.
PolylineTo(X1, Y1, [ X, Y, ... ])
Draws one or more straight lines.
Rectangle(LEFT, TOP, RIGHT, BOTTOM)
Draws a rectangle. The rectangle is outlined by using the current pen and filled by using the current brush.
ReleaseDC(HWND, HDC)
Releases a device context (DC), freeing it for use by other applications.
Restore([STATE])
Restores the state of the DC saved by Save()
. STATE can identify a state
from the saved stack (use the identifier returned by the corresponding
Save()
call) or a negative number that specifies how many steps backwards
in the stack to recall (eg. -1 recalls the last saved state).
The default if STATE is not specified is -1.
Note that the restored state is removed from the stack, and if you restore
an early one, all the subsequent states will be removed too.
Returns nonzero if succesful, zero on errors.
See also Save().
RestoreDC([STATE])
See Restore()
ROP2([MODE])
Gets or sets the foreground mix mode of the specified device context. The mix mode specifies how the pen or interior color and the color already on the screen are combined to yield a new color.
RoundRect(LEFT, TOP, RIGHT, BOTTOM, WIDTH, HEIGHT)
Draws a rectangle with rounded corners. The rectangle is outlined by using the current pen and filled by using the current brush.
Save()
Saves the current state of the DC (this means the currently selected
colors, brushes, pens, drawing modes, etc.) to an internal stack.
The function returns a number identifying the saved state; this number
can then be passed to the Restore()
function to load it back.
If the return value is zero, an error occurred.
See also Restore().
SaveDC()
See Save()
SelectClipRgn(Region)
This method selects a region as the current clipping region for the specified device context.
If no region is passed, then this method will remove a device-context's clipping region.
SelectObject(OBJECT)
Selects an object into the specified device context. The new object replaces the previous object of the same type.
SetBrushOrgEx(X, Y)
The SetBrushOrgEx method sets the brush origin that GDI assigns to the next brush an application selects into the specified device context. Returns the (x,y) of the previous brush origin.
SetMiterLimit(FLOAT)
Sets the limit for the length of miter joins
SetPixel(X, Y, [COLOR])
Sets the pixel at X, Y to the specified COLOR
(or to the current TextColor()
if COLOR is not specified).
SetTextJustification(BREAKEXTRA, BREAKCOUNT)
Specifies the amount of space the system should add to the break characters in a string of text
StretchBlt(XD, YD, WD, HD, SOURCE, XS, YS, WD, HD, [ROP=SRCCOPY])
Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a rectangle of pixels in the destination device context, performing stretching a necessary.
StretchBltMode([MODE])
Get or Set bitmap stretching mode in the specified device context.
StrokeAndFillPath()
Closes any open figures in a path, strokes the outline of the path by using the current pen, and fills its interior by using the current brush.
StrokePath()
Renders the specified path by using the current pen.
TextAlign([ALIGN])
Set or Get text-alignment setting for the specified device context.
TextCharacterExtra([CHAREXTRA])
Set or Get the intercharacter spacing.
TextColor([COLOR])
Gets or sets the text color.
TextOut(X, Y, TEXT)
Writes a character string at the specified location, using the currently selected font, background color, and text color.
Validate()
Validates (removes from the update region) the whole DC area. This function is intended to be used in a Paint event; see Win32::GUI::Graphic::Paint(). Returns nonzero if succesful, zero on errors.
WidenPath()
Redefines the current path as the area that would be painted if the path were stroked using the pen currently selected into the given device context.
Common events apply to most windows and controls.
Documentation for Win32::GUI v1.06 created 13 Feb 2008
This document is autogenerated by the build process. Edits made here will be lost. Edit docs/per_package.tpl instead.
Homepage: http://perl-win32-gui.sourceforge.net/.
For further support join the users mailing list(perl-win32-gui-users@lists.sourceforge.net
) from the website
at http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users. There is a searchable list archive at http://sourceforge.net/mail/.
Copyright (c) 1997..2008 Aldo Calpini. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.