GdiControl
Members
G
desc: A pointer to the graphics object that is associated with the drawing buffer (GridGUI.GdiControl.hbm
). Updated each timer the control is drawn with a new size.
type: GpGraphics*
meta: [pointer]
link: link
graphic
desc: Callback that is called each time the underlying control is drawn, but before the GridGUI.GdiControl.hbm
has been drawn on the underlying control. Bind the instance of GridGUI.GdiControl
to the callback and draw what you want the GridGUI.GdiControl
to show using the GridGUI.GdiControl.G
.
type: Func|BoundFunc|false
default: false
meta: [object]
hbm
desc: A handle to bitmap with the same size as the underlying control. Updated each timer the control is drawn with a new size.
type: HBITMAP
meta: [pointer]
link: link
hdc
desc: The device context allowing drawing on the GridGUI.GdiControl.hbm
by means of GridGUI.GdiControl.G
.
type: HDC
meta: [pointer]
pos
desc: The last position that this control was drawn at.
type: GridGUI.Position
default: new GridGUI.Position(0, 0)
meta: [object]
Methods
__CleanUp
__CleanUp()
Deletes or releases the GDI objects that the members point to.
__CreateCompatibleDC
__CreateCompatibleDC(hdc := 0)
This function creates a memory device context (DC) compatible with the specified device.
parameters
name: hdc
desc: Handle to an existing device context. If this handle is 0 (by default), the function creates a memory device context compatible with the application's current screen
type: HDC|number
default: 0
return value
desc: returns the handle to a device context or 0 on failure.
type: HDC
meta: [description and code taken from Gdip_All.ahk]
link: link
__CreateDIBSection
__CreateDIBSection(w, h, bpp := 32, ByRef ppvBits := 0)
The CreateDIBSection function creates a DIB (Device Independent Bitmap) that applications can write to directly.
parameters
name: w
desc: width of the bitmap to create.
type: number
name: h
desc: height of the bitmap to create.
type: number
name: bpp
desc: bits per pixel (32 = ARGB).
type: number
default: 32
name: ppvBits
desc: A pointer to a variable that receives a pointer to the location of the DIB bit values.
type: pointer
default: 0
meta: [ByRef, pointer]
return value
desc: A handle to a bitmap with width w
and height h
.
type: HBITMAP
meta: [description and code taken from Gdip_All.ahk]
link: link
__CreateRect
__CreateRect(ByRef Rect, x, y, w, h)
Creates a Rect object, containing a the coordinates and dimensions of a rectangle.
parameters
name: Rect
desc: Name to call the Rect object.
type: HRECT
meta: [ByRef]
name: x
desc: x-coordinate of the upper left corner of the rectangle.
type: number
name: y
desc: y-coordinate of the upper left corner of the rectangle.
type: number
name: w
desc: Width of the rectangle.
type: number
name: h
desc: Height of the rectangle.
type: number
meta: [description and code taken from Gdip_All.ahk]
__DeleteDC
__DeleteDC(hDC)
The DeleteDC function deletes the specified device context (DC).
parameters
name: hDC
desc: A handle to the device context. An application must not delete a DC whose handle was obtained by calling the GetDC function. Instead, it must call the ReleaseDC function to free the DC
type: HDC
return value
desc: If the function succeeds, the return value is nonzero.
type: number
meta: [description and code taken from Gdip_All.ahk]
__DeleteGraphics
__DeleteGraphics(pGraphics)
Deletes the graphics object pointed to by a pointer.
parameters
name: pGraphics
desc: The pointer to the graphics object that should be deleted.
type: GpGraphics*
return value
desc: Probably nonzero on success.
type: number
meta: [code taken from Gdip_All.ahk]
__DeleteObject
__DeleteObject(hObject)
This function deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid
parameters
name: hObject
desc: Handle to a logical pen, brush, font, bitmap, region, or palette to delete.
type: HGDIOBJ
return value
desc: Nonzero indicates success. Zero indicates that the specified handle is not valid or that the handle is currently selected into a device context.
type: number
meta: [description and code taken from Gdip_All.ahk]
__GraphicsFromHDC
__GraphicsFromHDC(hdc)
This function gets the graphics from the handle to a device context.
parameters
name: hdc
desc: A handle to the device context.
type: HDC
return value
desc: Returns a pointer to the graphics of a bitmap.
type: GpGraphics*
meta: [description and code taken from Gdip_All.ahk]
__New
__New(guiHwnd, options := "", graphic := false)
Constructor.
parameters
name: guiHwnd
desc: The hwnd of the gui that the GuiControl should be added to.
type: hwnd
name: options
desc: The options that the GuiControl will be created with. Does not accept vVars.
type: string
default: ""
link: link
name: graphic
desc: Callback that will be called each time the underlying control is drawn, but before the GridGUI.GdiControl.hbm
has been drawn on the underlying control. Bind the instance of GridGUI.GdiControl
to the callback and draw what you want the GridGUI.GdiControl
to show using the GridGUI.GdiControl.G
.
type: Func|BoundFunc|false
default: false
return value
desc: A new GridGUI.GdiControl
instance.
type: GridGUI.GdiControl
__Prepare
__Prepare(area)
Checks if the controls position or size has changed and if it has then recreated the gdi members.
parameters
__SelectObject
__SelectObject(hdc, hgdiobj)
The SelectObject function selects an object into the specified device context (DC). The new object replaces the previous object of the same type. See link for additional details.
parameters
name: hdc
desc: Handle to a DC
type: HDC
name: hgdiobj
desc: A handle to the object to be selected into the DC.
type: HGDIOBJ
return value
desc: If the selected object is not a region and the function succeeds, the return value is a handle to the object being replaced.
type: HGDIOBJ|number
meta: [description and code taken from Gdip_All.ahk]
link: link
__UpdateLayeredWindow
__UpdateLayeredWindow(hwnd, hdc, x := "", y := "", w := "", h := "", Alpha := 255)
Updates a layered window with the handle to the DC of a gdi bitmap.
parameters
name: hwnd
desc: Handle of the layered window to update.
type: hwnd
name: hdc
desc: Handle to the DC of the GDI bitmap to update the window with.
type: HDC
name: x
desc: X position to place the window. If omitted then the layered window will use its current x coordinate.
type: number|""
default: ""
name: y
desc: Y position to place the window. If omitted then the layered window will use its current y coordinate.
type: number|""
default: ""
name: w
desc: Width of the window. If omitted then the layered window will use its current width.
type: number|""
default: ""
link: link
name: h
desc: Height of the window. If omitted then the layered window will use its current height.
type: number|""
default: ""
link: link
name: Alpha
desc: The value in the range (0-255) to set the window transparency.
type: number
default: 255
return value
desc: If the function succeeds, the return value is nonzero.
type: number
meta: [description and code taken from Gdip_All.ahk]
Draw
Draw(pos)
Draws the underlying control at the new position and size. As well as calling GridGUI.GdiControl.UpdateGraphic
.
parameters
GDIDraw
GDIDraw()
Draws the GridGUI.GdiControl.hbm
(bitmap) on the underlying control, and updates the position and size of the control to the one in GridGUI.GdiControl.pos
.
UpdateGraphic
UpdateGraphic()
Calls the user callback GridGUI.GdiControl.graphic
if defined, before calling GridGUI.GdiControl.GDIDraw
.