Draw Method
Description
Draws the image to the specified device context.
Syntax
Public Sub Draw( _
ByVal [hDC](#) As Integer, _
ByVal [x](#) As Integer, _
ByVal [y](#) As Integer, _
ByVal [cx](#) As Integer, _
ByVal [cy](#) As Integer, _
ByVal [state](#) As [XTPImageState](XtremeCalendarControl~Enumerations~XTPImageState_EN.md) _
)
Parameters
- hDC: A handle to the destination device context.
- x: The x-coordinate of the upper left corner of the destination rectangle. This is the location at which to draw within the specified device context.
- y: The y-coordinate of the upper left corner of the destination rectangle. This is the location at which to draw within the specified device context.
- cx: Width of the destination image in pixels.
- cy: Height of the destination image in pixels.
- state: Specifies in which "state" to draw the image. The image can be drawn in a normal, disabled, hot, or checked state.
State Values
| Value | Description |
|---|---|
| xtpImageNormal | Specifies a normal icon. This is the image displayed when the item is displayed normally. |
| xtpImageDisabled | Specifies a disabled icon. This is the image displayed when the item is disabled. |
| xtpImageHot | Specifies a hot icon. This is the image displayed when the mouse pointer is positioned over the item. |
| xtpImageChecked | Specifies a "checked" or selected icon. This is the image displayed when the item is in a selected state. |
| xtpImagePressed | Specifies a "pressed" or pushed icon. This is the image displayed when the item is currently pressed by the mouse cursor. |
Remarks
The image will be stretched or compressed as necessary to fit the bounds provided by cx and cy. The Width and Height properties store the width and height of the image and can be used for the cx and cy parameters so the image is drawn at its original size.
You can determine if the values stored in the Width and Height properties represent the original image size from the Icons collection by checking to see if it has been Scaled.
See Also
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.