ImageMan ActiveX Control Version 8
CreateBitmap Method
See Also  Example  Send comments on this topic.
Width

Specifies the Image width in pixels

Height

Specifies the Image height in pixels

BitDepth
Specifies the Bit Depth of the image

Glossary Item Box

Description

Create a blank bitmap of the specified size and color depth.

Syntax

Visual Basic
Public Sub CreateBitmap( _
   ByVal Width As Long, _
   ByVal Height As Long, _
   ByVal BitDepth As Integer _
) 

Parameters

Width

Specifies the Image width in pixels

Height

Specifies the Image height in pixels

BitDepth
Specifies the Bit Depth of the image

Remarks

The blank bitmap created using this method can be drawn upon using the Windows API and the hDC property. If the Bit depth is 8 or less then the Red, Green and Blue properties can be used to populate the palette entries for the image.

Example

CreateBitmap (Visual Basic)Copy Code
ImageControl1.CreateBitmap 100, 100, 24

' Now draw an X on the image using the MoveTo, LineTo API functions

MoveTo ImageControl1.hDC, 0, 0

LineTo ImageControl1.hDC, 100, 100

MoveTo ImageControl1.hDC, 100, 0

LineTo ImageControl1.hDC, 0, 100

' Save the image in x.tif

ImageControl1.SaveAs "x.tif"

'Clear the image from the control

ImageControl1.Picture = ""

See Also

© 2014 Data Techniques Inc. All Rights Reserved.