ImageMan ActiveX Control Version 8
hDC Property
See Also  Example  Send comments on this topic.

Glossary Item Box

Description

Returns a Windows Device Context for drawing on the image in the control.

Property type

Read-only property

Syntax

Visual Basic
Public Property hDC As Integer

Remarks

This property must be obtained for each image and allows you to use the Windows API functions to draw into the image. The changes made by using the hDC property change the internal bitmap maintained by the control. The altered image can be printed, saved or copied to the clipboard.

This property is available only at runtime.

Example

(Visual Basic)Copy Code
Private Type POINTAPI
    X As Long
    Y As Long
End Type

 
Private Declare Function LineTo Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function MoveToEx Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, lpPoint As POINTAPI) As Long



Dim ImghDC As Long
Dim pTemp As POINTAPI
Dim nStore As Long

' Draw an X through the image
ImghDC = ImageControl1.hDC

' These calls will draw an X over the image
MoveToEx ImghDC, 0, 0, pTemp
LineTo ImghDC, ImageControl1.ImageWidth, ImageControl1.ImageHeight
nStore = MoveToEx(ImghDC, ImageControl1.ImageWidth, 0, pTemp)
nStore = LineTo(ImghDC, 0, ImageControl1.ImageHeight)

' Update the image on screen
ImageControl1.Refresh

See Also

© 2014 Data Techniques Inc. All Rights Reserved.