Return to Touch22 Homepage     Image22 ActiveX
Image22 help
1.Image22 overview
2.Image22 methods and properties:
2.1.Image22 Methods:
2.1.1.CreateImage
2.1.2.LoadFromFile
2.1.3.CreateImageFromWindow
2.1.4.SaveToFile
2.1.5.SetFont
2.1.6.SetResolution
2.1.7.Resize
2.1.8.DrawText
2.1.9.DrawLine
2.1.10.DrawEllipse
2.1.11.DrawRectangle
2.1.12.DrawEdge
2.1.13.DrawIcon
2.1.14.DrawExtractedIcon
2.1.15.DrawImage
2.1.16.Clear
2.2.Image22 Properties
2.2.1.MimeType
2.2.2.ImageData
2.2.3.Height
2.2.4.Width
2.2.5.FgColor
2.2.6.BgColor
2.2.7.Opaque
1.Image22 overview
Image22 ActiveX allows you to create images dynamically on the fly from inside your application.
Features include:
Image22 COM objects work with Visual Basic, Visual C++ and other (D)COM/ActiveX/Win 32 compatible development environments.
Features include:
  • Creating new images
  • supported formats are: BMP, JPEG, GIF, TIFF, PNG
  • Modifying existing images
  • Captures a specified window
  • Extracting an icon: extract icon from executable file into a final image
  • Collage effect: combine multiple images into a final image
  • Dynamic transparency: enables changing transparency of an object at run time
  • Supports Response.BinaryWrite
  • Image resizing. Ability to stretch-squeeze or add-cat image to new dimentions
  • Ability to scale images properly setting the resolution of the image
  • Variety of draw methods
2.Image22 methods and properties:
2.1.Image22 Methods:
2.1.1.CreateImage
Creates an image that has the specified dimensions and background color.
Syntax:
object.CreateImage( Width, Height, Color)
The CreateImage method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
Width Required. A numeric expression that specifies a width of the image.
Height Required. A numeric expression that specifies a height of the image.
Color Required. An OLECOLOR RGB value that specifies the background color. You can also specify a color by using any integer that represents a valid color or by using string constants defined on file IMG22.CFG which is supplied with a program.
Example:
CreateImage(200,150,"lightgreen");
2.1.2.LoadFromFile
Creates an image from a specified file.
Syntax:
object.LoadFromFile( ImageFile )
The LoadFromFile method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
ImageFile Required. A string expression that specifies the image source file
2.1.3.CreateImageFromWindow
Creates an image object and copies to the image a specified window picture. This function captures a specified window to a new image object.
Syntax:
object.CreateImageFromWindow( WindowTitle, WindowClass, WindowModul )
The CreateImageFromWindow method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
WindowTitle Optional. A string expression that specifies the window title.
WindowClass Optional. A string expression that specifies the window class name.
WindowModul Optional.  A string expression that specifies the modul name associated with window (application name).
2.1.4.SaveToFile
Saves final image to the specified file
Syntax:
object.SaveToFile( ImageFile )
The SaveToFile method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
ImageFile Required. A string that contains the name of the file to which to save image.
2.1.5.SetFont
Specifies the font to be used in DrawText method
Syntax:
object.SetFont( Effects, Size, Typeface )
The SetFont method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
Effects Required. A numeric expression evaluates an font effect, can be any combination of properties: Font Bold = 1; Font Italic = 2; Font Underline = 4; Font Strikeout = 8
Size Required. A numeric expression that specifies an font size
Typeface Required. A string expression that specifies a font name
2.1.6.SetResolution
Specifies the resolution
Syntax:
object.SetResolution( nHorz, nVert )
The SetResolution method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
nHorz Required. A numeric expression that specifies the horizontal resolution, in dots per inch
nVert Required. A numeric expression that specifies the vertical resolution, in dots per inch
2.1.7.Resize
Resizes the image to the specified width and height
Syntax:
object.Resize(newWidth, newHeight)
The Resize method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
newWidth Required. The new width of the image
newHeight The new height of the image
2.1.8.DrawText
Draws text on the specified coordinates
Syntax:
object.DrawText(Text, PosX, PosY);
The DrawText method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
Text Required.  A string expression that specifies the text to display
PosX Required. A numeric expressions that specifies x location on the surface to draw text
PosY Required. A numeric expressions that specifies y location on the surface to draw text
2.1.9.DrawLine
Draws a line on the surface
Syntax:
object.DrawLine(FromX, FromY, ToX, ToY)
The DrawLine method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
FromX, FromY Required. Numeric expressions that specifies the first point coordinates
ToX, ToY Required. Numeric expressions that specifies the second point coordinates
2.1.10.DrawEllipse
Draws an ellipse in the specified bounding rectangle
Syntax:
object.DrawEllipse( PosX, PosY, Width, Height);
The DrawEllipse method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
PosX, PosY Required. Numeric expressions that specifies coordinates of top-left corner of rectangle in which to draw the ellipse
Width, Height Required. Numeric expressions that specifies width and height of the rectangle in which to draw the ellipse
2.1.11.DrawRectangle
Draws a rectangle using the specified coordinates
Syntax:
object.DrawRectangle( PosX, PosY, Width, Height)
The DrawRectangle method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
PosX, PosY Required. Numeric expressions that specifies coordinates of top-left corner of rectangle
Width, Height Required. Numeric expressions that specifies width and height of the rectangle
2.1.12.DrawEdge
Draws edges of a rectangle of the specified type and style
Syntax:
object.DrawEdge( PosX, PosY, Width, Height, EdgeType, BordeType)
The DrawEdge method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
PosX, PosY Required. Numeric expressions that specifies coordinates of top-left corner of rectangle
Width, Height Required. Numeric expressions that specifies width and height of the rectangle
EdgeType Required. Numeric values. Specifies the type of edge to draw. Use any of next values: 5 - Raised edge; 6 - Etched edge; 9 - Bump edge; 10 - Sunken edge;
BordeType Required. Numeric values. Specifies the type border. Use any combination of next values: 1 - Left border; 2 - Top border; 4 - Right border; 8 - Bottom border; 16 - Diagonal border;
2.1.13.DrawIcon
Draws an icon associated with specified file extension
Syntax:
object.DrawIcon( FileExt, PosX, PosY, bSmall )
The DrawIcon method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
FileExt Required. A string expression containing the file extention
PosX, PosY Required. Numeric.The coordinates of top-left corner of the icon
bSmall Required. A numeric expression, can be 0 - for large icon, 1 - for small icon.
2.1.14.DrawExtractedIcon
Extracts an indexed icon found in a file and draws the icon on specified coordinates
Syntax:
object.DrawExtractedIcon( FilePath, PosX, PosY, nIcon, bSmall )
The DrawExtractedIcon method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
FilePath Required. A string expression specifies the full path and file name of the file that contains the icon.
PosX, PosY Required. Numeric.The coordinates of top-left corner of the icon
nIcon Required. A numeric expression specifies the index of the icon
bSmall Required. A numeric expression, can be 0 - for large icon, 1 - for small icon
2.1.15.DrawImage
Draws an image in the specified location and size
Syntax:
object.DrawImage ( ImageFile, PosX, PosY, Width, Height )
The DrawImage method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
ImageFile Required. A string expression specifies the full path and file name of the file that contains the image
PosX, PosY Required. Numeric.The coordinates of top-left corner of image.
Width, Height Numeric.The width and height of the image.
2.1.16.Clear
Clears the surface of the image object
Syntax:
object.Clear()
The Clear method  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
2.2.Image22 Properties
2.2.1.MimeType
Gets and puts the mime type of the image object
Syntax:
object.MimeType[ = value ]
The MimeType property  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
value Required. A string expression that specifies the mime type. Use one of supported mime types: "image/bmp" ; "image/jpeg" ; "image/gif" ; "image/tiff" ; "image/png" ;
Example:
ImgObj.MimeType = "image/gif" ;
2.2.2.ImageData
Gets the binary data of the current image. Use this property to write image data directly to the client content. Be sure to set ContentType to a proper value
Syntax:
[ variable = ] object.ImageData
The ImageData property  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
variable Required. A VARIANT that receives the ImageData
Example:
Response.ContentType = ImgObj.MimeType ;
Response.BinaryWrite ( ImgObj.ImageData );
2.2.3.Height
Specifies the Height of the image object
Syntax:
object.Height [ = value ]
The Height property  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
value Required. A numeric expression that specifies the height of the image
Example:
ImgObj.Height = 200;
2.2.4.Width
Specifies the Width of the image object
Syntax:
object.Width [ = value ]
The Width property  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
value Required. A numeric expression that specifies the width of the image
Example:
ImgObj.Width = 200;
2.2.5.FgColor
Specifies the foreground color of the image
Syntax:
object.FgColor [ = value ]
The FgColor property  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
value Required. An OLECOLOR RGB value that specifies the foreground color. You can also specify a color by using any integer that represents a valid color or by using string constants defined on file IMG22.CFG which is supplied with a program.
Example:
ImgObj.FgColor = "#ff00ff";
2.2.6.BgColor
Specifies the background color of the image
Syntax:
object.BgColor [ = value ]
The BgColor property  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
value Required. An OLECOLOR RGB value that specifies the background color. You can also specify a color by using any integer that represents a valid color or by using string constants defined on file IMG22.CFG which is supplied with a program.
Example:
BgColor.FgColor = "lightgreen";
2.2.7.Opaque
Specifies whether background is opaque or transparent
Syntax:
object.Opaque [ = value ]
The Opaque property  syntax has these parts:
Part Description
object Required. An object expression that evaluates to the SMS22 object
value Required. A Boolean value corresponding to the background transparency (a value of false means "transparent")
Example:
ImgObj.Opaque = false;
Copyright © 2001-2012 Touch22 .  All Rights Reserved.