iASP_Image Component

Overview

 

The iASP_Image component allows developers to create or modify transition images from ASP very easily. Features allow you to:

  • Work with GIF (RLE only) JPEG, PNG, and BMP formats
  • Create new and modify existing images
  • Add text and images transparently
  • Create gradient fills
  • Draw methods such as rectangle, arc, and circle
  • Crop, flip, resize, and rotate images
  • Button, darken, lighten, and other effects
  • Load images from OLE variants or other iASP-Image objects
  • Support Response.BinaryWrite

Properties

Methods Description
AntiAliasText The AntiAliasText allows you to create anti-aliased text on the image. By default AntiAliasText is false.

Example:     

Image.AntiAliasText = True

AutoClear AutoClear is true by default. Once an image is saved the current image is cleared. By setting AutoClear to false you can retain the existing image after a save to continue working with it.

Example:

Image.AutoClear = false

AutoSize AutoSize determines whether or not an image should be clipped when a draw request that falls outside of the images current coordinates occurs. If AutoSize is true then the image will be enlarged to handle the request. If AutoSize is false then the draw request will be clipped to fit within the current image.

Example:

Image.AutoSize = False
BackgroundColor Integer value specifies the background color.

Example:

Image.BackgroundColor = vbWhite
Bold True/false value determines if font is bold or not.

Example:

Image.Bold = True
BrushStyle The BrushStyle property determines the pattern painted by the brush.
Value Type
0 Solid
1 Clear
2 Horizontal
3 Vertical
4 FDiagonal
5 BDiagonal
6 Cross
7 DiagCross
Error The Error property is used to report any errors that may have occurred during various method calls.

Example:

Response.Write "Error: " & Chart.Error
Expires If the component is an eval or beta version the expires property will return the date that the component quits functioning.

Example:

Response.Write "Component Expires: " & Image.Expires
FileName The FileName property specifies the physical path where a file will be saved using the SaveImage method.

Example:

Image.FileName = "d:\inetpub\wwwroot\images\abc.jpg"
FontColor The integer FontColor specifies the color of the font.

Example:

Image.FontColor = vbRed
FontName The string FontName specifies the name of the font.

Example:

Image.FontName = "MS Sans Serif"
FontSize The integer FontSize specifies the size of the font.

Example:

Image.FontSize = 12
Image Image is a read only property that contains the binary data for the current Image. You can use this to write the binary data directly to the client rather than using the SaveImage method. Your application design should dictate the best method to use. From ASP you can use Response.BinaryWrite to write this image data to the client. Be sure and set ContentType to the proper content-type. Currently the Image property only supports JPEG or PNG data. See the included file BinWText.asp for an example of how to use this property. Set the ImageFormat property to JPG or PNG before using this property.
ImageFormat ImageFormat determines what graphics for the image will be saved to. Valid values are
  • JPG = 1
  • BMP = 2
  • PNG = 3

Example:

Image.ImageFormat = 2
Italic True/false value determines if font is italic or not.

Example:

Image.Italic = True
JPEGQuality If the ImageFormat is set to JPEG then the JPEGQuality property specifies the quality of the JPEG image to be saved. Valid values are 1-100.

Example:

Image.JPEGQuality = 95
MaxX The MaxX property determines the X size of the image.

Example:

Image.MaxX = 100
MaxY The MaxY property determines the Y size of the image.

Example:

Image.MaxY = 100
PadSize The PadSize property allows you to automatically placed horizontal and vertical padding around text.

Example:

Image.PadSize = 5
PenColor Color determines the color used to draw lines on the canvas.

Example:

Image.PenColor = &h80000011
PenStyle Style determines the style in which the pen draws lines.
Value Type Description
0 Solid A solid line.
1 Dash A line made up of a series of dashes.
2 Dot A line made up of a series of dots.
3 DashDot A line made up of alternating dashes and dots.
4 DashDotDot A line made up of a serious of dash-dot-dot combinations.
5 Clear No line is drawn (used to omit the line around shapes that draw an outline using the current pen).
6 InsideFrame A solid line, but one that may use a dithered color if Width is greater than 1.
PenWidth Width specifies the maximum width of the pen in pixels.

Example:

Image.PenWidth = 2
ProgressiveJPEGEncoding ProgressiveJPEGEncoding determines whether an image can be progressively displayed when it is decompressed. ProgressiveJPEGEncoding is off by default.

Example:

ProgressiveJPEGEncoding = true
RegisteredTo Returns the name of the customer or company who purchased the component or "Evaluation" if the component is an evaluation copy.
Strikeout True/false value determines if font is strikeout or not.

Example:

Image.Strikeout = False
TextAngle The TextAngle property determines the angle the text written with TextOut is written at. By default TextAngle is 0.

Example:

Image.TextAngle = 90
ThreeDColor Sets the text color used for 3d text.

Example:

Image.ThreeDColor = &h80000011
TransparentText Determines whether the TextOut method writes text to the image in transparent mode or not. By default this property is true.

Example:

Image.TransparentText = true
Underline  True/false value determines if font is underlined or not.

Example:

Image.Underline = False
Version Gets the internal component version number.

Example:

Response.Write "Component Version: " & Image.Version
X Indicates the current X (horizontal) position of the cursor on the image.

Example:

Image.X = 10
Y Indicates the current Y (vertical) position of the cursor on the image.

Example:

Image.Y = 10

Methods

Method Parameters Return Value Description
AddImage strFileName, intX, intY True/False Adds a new image to the canvas using the intX and intY coordinates.
AddImageTransparent strFileName, intX, intY, intTransparentColor True/False Adds a new image to the canvas using the intX and intY coordinates. intTransparent in the image strFilename is treated as transparent. intTransparentColor is the exact color to make transparent. "Similar" colors are not replaced.
Arc intX1, intY1, intX2, intY2, intX3, intY3, intX4, intY4 N/A Draws an arc on the image along the perimeter of the ellipse bounded by the specified rectangle.
BrightenImage intDegree N/A Makes the existing image appear brighter.

Example:

Image.BrightenImage 30

CreateBlackWhite N/A N/A Turns the current image into a greyscale image.
CreateButton intBorder, bolSoft N/A Creates a button like border around the image for intBorder pixels. If bolSoft is true the button border is softened.

Example:

Image.CreateButton 10, true

CreateNegative N/A N/A Creates a negative image effect of the current image.
CropImage intStartX, intStartY, intWidth, intHeight N/A Crops the image using the X, Y, width and height specified.
Chord intX1, intY1, intX2, intY2, intX3, intY3, intX4, intY4 N/A Draws a closed figure represented by the intersection of a line and an ellipse.
ClearImage N/A N/A Clears the image canvas using the current BackgroundColor as the fill color.
DarkenImage intDegree N/A Makes the existing image appear darker.

Example:

Image.DarkenImage 30

Ellipse intX1, intY1, intX2, intY2 N/A Ellipse draws the ellipse defined by a bounding rectangle on the image.
FillRect intLeft, intTop, intRight, intBottom N/A FillRect fills the specified rectangle on the image.
FlipImage intDirection N/A Flips the image

Valid values for intDirection are:

  • 1 : Horizontal
  • 2 : Vertical
FloodFill intX, intY, intColor, intFillStyle N/A Use FloodFill to fill a possibly non-rectangular region of the image. The boundaries of the region to be filled are determined by moving outward from the point (X,Y) until a color boundary involving the Color parameter is encountered. Floodfill uses the BackgroundColor and BrushStyle properties.

Legal values for intFillStyle are:

Value Type Description
0 Surface Fills all area that has the color indicated by the intColor parameter but stops when another color intersects.
1 Border Fills all area that does not have the color indicated by the intColor parameter but stops when intColor intersects.
FrameRect intLeft, intTop, intRight, intBottom N/A Draws a 1 pixel wide border around a rectangular region using the points specified.
LoadImage strFileName True/False Loads an existing image into the image canvas. You can load JPG, and BMP files.

LoadImage resets font changes so that changes to the font size, name and characteristics for new text are lost. If you use the LoadImage procedure be sure you make fonts modifications after the call to LoadImage.

GradientOneWay intBeginColor, intEndColor, intDirection N/A Creates a one way gradient beginning with the color intBeginColor and ending in the color specified by intEndColor.
GradientTwoWay intBeginColor, intEndColor, intDirection, intInOut N/A Creates a two way gradient beginning with the color intBeginColor and ending in the color specified by intEndColor.
LineTo intX, intY N/A Creates a line from properties X, Y and going to intX, intY.
LoadBlob ovBlob, intType True/False LoadBlob is designed to allow the loading of binary image data from other AspImage objects (using the .Image property for ovBlob) or from other data sources where binary image data is available via an OLE variant pointer. ovBlob is an OLE variant pointing to raw image data. The raw image data is loaded onto the AspImage canvas.The parameter intType indicates what type of format the binary data is in. Valid intTypes are:
  • 1 : JPEG
  • 2: BMP

Example:

Set Image = Server.CreateObject("AspImage.Image")
Image.LoadImage ("d:\inetpub\wwwroot\images\map.jpg")
Image.FlipImage 2
Image.ImageFormat = 1

Set Image2 = Server.CreateObject("AspImage.Image")
Image2.LoadBlob Image.Image, 1
[Image2 now has a flipped image of map.jpg]

Pie intX1, intY1, intX2, intY2, intX3, intY3, intX4, intY4 N/A Draws a pie-shaped the section of the ellipse bounded by the rectangle (X1, Y1) and (X2, Y2) on the image.
Rectangle intX1, intY1, intX2, intY2 N/A Creates a rectangle using the points specified.
Resize intWidth, intHeight N/A Resizes image to intWidth, intHeight
RotateImage intDegrees N/A Rotates image to specified angle.
RoundRect intX1, intY1, intX2, intY2, intX3, intY3 N/A Creates a round rectangle using the points specified.
SaveImage N/A True/False Saves the current image canvas into the file specified in the property FileName.
TextOut strText, intX, intY, bol3d N/A TextOut writes a text value using the current font, color and other characteristics to the image at the location specified by intX and intY. If bol3d is true then the text is rendered using a 3d look.
TextHeight strValue Integer Returns the text height for strValue using the current font, font size and font characteristics.
TextWidth strValue Integer Returns the text width for strValue using the current font, font size and font characteristics.
TintImage intColor N/A Takes an existing image and shades the image with tints of intColor.

Example:

Image.TintImage vbBlue

If you require technical support please send complete details about the problem you are having to support@halcyonsoft.com.


Copyright © 1998-2002, Halcyon Software Inc. All rights reserved.