當網頁上要顯示的圖片並不是靜態/固定式內容,而是希望具有動態文字內容的圖片的話,AspImage元件可以讓asp程式做出此效果。
什麼時候會需要具有動態文字內容的圖片? 例如,設計讓系統發出一封通知信HTML code如下
本to-do item目前處理狀態為<img src='http://sever/task.asp?id=123&get=status'>,
目前貼文發表篇數為<img src='http://sever/task.asp?id=123&get=post_num'>
因為希望每次打開該通知信時,上述兩個img的部分都能呈現目前最新狀況,所以就需要動態式圖片,而非靜態式圖片--img src網址的結尾是固定的圖檔名稱。注意,上述兩個img src所呼叫的是.asp程式(或其他.aspx, .jsp, .php等都可以),asp程式將依據URL參數(此例為id and get)運算後,「吐」回一個圖片檔內容,然後被顯示在outlook上、或其他email收發軟體上,而達到每次打開該email,所看到的圖片內容都是反映最新情況的效果。
透過這樣的技巧,原本固定式的email內容,就變成有動態式內容效果了。
好,接下來的問題是,一般asp都是「吐」出HTML code,怎麼讓它改成「吐」出一個圖片? 那就要用AspImage這類的元件了。以下是ServerObjects公司的AspImage 2.x 完整documentation。Download can be found here, wherein it shows this component is free.
AspImage 2.x
About ASPImage
ASPImage allows you to create images on the fly from ASP. Features include:
- Create GIF* (RLE encoding only. Loading of GIFs not supported) JPG, PNG, BMP, TGA and PCX format images.
- Modify existing images (JPG, BMP, PNG, TGA and PCX)
- Gradient fills
- Animated GIF creation
- A large variety of draw methods
- Transparent PNG and GIF
What's New in 2.x
- Loading existing PNG, TGA and PCX files is now supported
- Creation of WBMP files for WAP is now supported. Loading of WBMPs not supported
- Better behavior under IIS 4.x w/MTS.
- Many new methods including Blur, Contrast, Emboss, Sharpen, Wave
- Multiple methods for resizing. Resize provides a quick method to shrink images while ResizeR produces a resized image by resampling (and therefore takes a little longer).
ASPImage Installation
To use this ASP component move the DLL into a subdirectory (like \winnt\system32 for NT or \windows\system for Win95). Please use the version of regsvr32 that is included with this component or the version that comes with Microsoft ASP (they are the same version).
To register the component on the system change to the directory where you installed the DLL and type:
regsvr32 aspimage.dll
Simple Image Example
Using the component is as simple as
- Creating the object
- Setting a few properties
- Calling the SaveImage method
The following code demonstrates how to use ASPImage from VBScript. In this example we'll create a text image that say's "Welcome to" with a gradient fill.
Set Image = Server.CreateObject("AspImage.Image") rem Set various font parameters Image.FontColor = vbBlack Image.Italic = True Image.Bold = True Image.FontName = "Arial" Image.FontSize = 12 Image.PadSize = 10 rem Calculate how big our text info is and set the image to this size rem This has to be done since we want to fill the area with a gradient strMessage = "Welcome to" Image.MaxX = Image.TextWidth (strMessage) Image.MaxY = Image.TextHeight (strMessage) rem Create a one way gradient Image.GradientOneWay vbRed, vbWhite, 0 rem Print our string to the image Image.TextOut strMessage, Image.X, Image.Y, false rem Set the filename and save Image.FileName = "d:\inetpub\wwwroot\images\msg1.jpg" if Image.SaveImage then rem The image was saved so write the <img src> tag out for the browser to pick up Response.Write "<img src=""/images/msg1.jpg""><br>" else rem Something happened and we couldn't save the image so just use an HTML header rem We need to debug the script and find out what went wrong. See Image.Error for details Response.Write "<h2>Welcome to</h2>" end if
By testing the result of the SaveImage method we can determine if the image save was successful or not. If something happened that causes the image not to be saved it probably means the script is saving the image to an invalid directory or a directory where write rights do not exist.
GIF Animations
Images can be loaded or manipulated and then as these modifications occur you can save them to an animated sequence using the call AddImageToAnimation. A simple example of GIF animation can be found in soianim.asp which is included with the eval zip file for AspImage.
About purchasing ASPImage
- The license fee covers only one CPU per license. The product may be purchased online from http://www.serverobjects.com/products.htm
About Upgrades
- Users can upgrade for free for minor version changes. For example, upgrades from version 1.00 to 1.99 are free. The upgrade from 1.99 to 2.0 may carry an additional license fee.
- How to get upgrades
- The latest version of the components are always available at http://www.serverobjects.com/products.htm. If a fee is associated with obtaining the upgrade it will be noted on that page.
Upgrade Instructions
To upgrade the component from a previous version please follow these steps:
- Stop all IIS related services such as Gopher, FTP and W3SVC.
- Change to the directory where the component is located and type "regsvr32 /u aspimage.dll"
- Move the new copy of aspimage.dll to the current directory and type "regsvr32 aspimage.dll"
- Restart any necessary IIS related services.
Common Problems
http://www.serverobjects.com/TechComm.htm
Failures reading and/or writing image files.
Check directory security and make sure that the IIS user (authenticated and/or anonymous) has security permissions that allow read/write to the directories in question. The same problem may occur when using the AddImage method. If this fails make sure the image file is valid and that proper security permissions have been granted for the component to access the file.
Questions about AspImage
The browser is caching the image so my image is not updated on each request. What can I do about that? |
Web browsers tend to cache images. This is a browser problem, not an AspImage problem. The only solutions we know of are the following:
Please do not write asking for help with this problem. We cannot do any more than point out the problems associated with these browsers and suggest workarounds. If you need further assistance please contact the browser manufacturer to find out where you can get support for their product. If you want to complain about the problem please contact the browser manufacturer and ask them why their caching algorithms are flawed. ;-) |
What color constants are defined by VBScript? |
The standard color constants are:
You can, of course, add your own constants to your scripting code. For example: vbGrayText = &80000011 |
How do I resize and maintain the aspect ratio? |
Something like this will do the trick: Sub ResizeX (intXSize) Dim intYSize intYSize = (intXSize / Image.MaxX) * Image.MaxY Image.ResizeR intXSize, intYSize end sub |
I'm calling SaveImage but nothing is getting written out. What's wrong? or I am getting "Cannot create file" |
There are a few possible reasons for this:
You can check the Error property for O/S result codes that identify problems after an attempted save. |
I set the AntiAliasText property to false but it still looks like the text is anti-aliased. | You are using JPEG encoding and color bleeding is possible with JPEG encoding. The only option is to use another graphic format. |
How do I use Adobe Type1 fonts? |
This is only possible under Win2K. NT4 does not support this. To add Type1 fonts using AddFont seperate the PFM and PFB filenames with the "|" character. Do not put spaces anywhere in the font path string. AddFont will return a TRUE value if the font was successfully added. The AspImage Error property will return Win32 O/S result codes if an error occurs. Reasons for failure to add the font include:
bolResAddFont = Image.AddFont _ ("D:\WinNT\Fonts\COO_____.PFM|D:\WinNT\Fonts\COO_____.PFB") if bolResAddFont then Image.FontName = "Courier-Oblique" else Response.Write "Failed to add font. O/S Error was: " & Image.Error end if |
My image is 2 or 4 pixels larger than what I am setting MaxX and MaxY to. | Set PadSize property to 0 (zero) immediately after creating the AspImage object. |
ResizeR is much slower than Resize. What can I do to increase the speed? | ResizeR resizes by "resampling" and is much slower. There is nothing you can do to speed the call up except put faster hardware behind it. |
When I create a new image pixel 0,0 is the wrong color. |
That's because pixel 0,0's color was set already to a particular color (usually black) and you resized the image. Pixel 0,0's color was not reset. If you want to have pixel 0,0 set to another color then after you resize you can:
|
How do I convert HTML colors to RGB colors? |
HTML colors are easily converted to RGB values using the VBScript RGB function. For example the HTML color #E2BBF3 can be converted to RGB as follows Image.GradientStartColor = vbWhite Image.GradientEndColor = RGB(&hE2, &hBB, &hF3) |
After I load an image how do I find out the Height and Width of the image loaded? |
Response.Write "Image Height = " & Image.MaxY & " - Image Width = " & Image.MaxX |
I add an image but it doesn't automatically resize the image. What's wrong? | AspImage only resizes automatically when text is added. There are a number of possible scenarios a user might wish to occur when an image is added and so we do not automatically resize the image in this event. You can manually resize the image if you choose to. |
Why doesn't AspImage support GIF? | Unisys differentiates between servers and workstations in their GIF licensing policies. In the case of Web servers, they expect the operator of the Web server to pay $1500 a year to allow dynamic generation of GIF images. Our suggestion is to avoid GIF. We don't support GIF LZW (Unisys) under any conditions. |
Is it possible to set the color used by commands such as Rectangle and Ellipse? | See the PenColor, PenStyle and PenWidth properties. |
When I draw and ellipse (or other shapes) I don't want the background image to be modified. |
Set Image.BrushStyle = 1 ' set brush style to "clear" rather than 0 which is "solid". |
Do you support non-TrueType fonts / PS type fonts? | No, there is no direct support for non-TrueType fonts. You will have to test your fonts using the FontName property to see if your non-TT fonts work. |
The AntiAliasText property does not seem to work with smaller fonts. |
AspImage uses the Win32 O/S calls to antialias text. The following notes are provided by Microsoft MSDN: "Windows NT 4.0 and later (Win2K): Font is always antialiased if the font supports it and the size of the font is not too small or too large. "Windows 95 and later: In addition to the comments for Windows NT, the display must greater than 8-bit color, it must be a single plane device, it cannot be a palette display, and it cannot be in a multiple display monitor setup." Customer suggested workaround: "When you need correctly antialiased text in a font-size below the critical antialias-level, just multiply the needed font/imagesize by -say- 3 (I used this factor and it works fine) Let AspImage make your image in the normal way, but before you save the image use ResizeR to scale the image down by 3. This makes perfectly antialiased text in smaller fontsizes. I thought I'd let you know, because this workaround can extend the usability of your product.The extra step of resizing the image may be a problem for some users, but I think most users will appreciate it when this workaround will be added to the documentation." (MvH) |
Are alpha channels supported in the tga format | No |
Technical Support
If you require technical support please see our tech support page at http://www.serverobjects.com/support.htm
ASPImage Properties
Property | 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 for NEW image manipulations. It does not magically set the "background" to the specified color. Example: Image.BackgroundColor = vbWhite Image.ClearImage 'now clear the image to white. |
|||||||||||||||||||||||||||
Bold |
True/false value determines if font is bold or not. Example: Image.Bold = True |
|||||||||||||||||||||||||||
BrushColor |
The BrushColor property determines the color of the brush. (available in version >= 1.8) Image.BrushColor = VbRed |
|||||||||||||||||||||||||||
BrushStyle |
The BrushStyle property determines the pattern painted by the brush.
|
|||||||||||||||||||||||||||
DPI |
Get or set the DPI value for JPG and BMP files. (available in version >= 2.27) Image.DPI = 96 |
|||||||||||||||||||||||||||
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. The default value is JPG. Valid values are
Example: Image.ImageFormat = 5 Image.FileName = "c:\inetpub\wwwroot\images\logo.gif" Image.SaveImage |
|||||||||||||||||||||||||||
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.
|
|||||||||||||||||||||||||||
PenWidth |
Width specifies the maximum width of the pen in pixels. Example: Image.PenWidth = 2 |
|||||||||||||||||||||||||||
PixelFormat |
Determines the bit depth of saved images (JPG and PNG are always 24bit). In memory manipulation of images typically occurs in 24bit mode and by default images are 24 bits. (available in version >= 2.25)
|
|||||||||||||||||||||||||||
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 |
|||||||||||||||||||||||||||
TextAlign |
Sets the text alignment for calls to TextOut. The default value is 0 (left).
Image.TextAlign = 6 |
|||||||||||||||||||||||||||
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 |
|||||||||||||||||||||||||||
Transparent | Determines if an image is transparent for GIF or PNG files. False by default. (available in version >= 2.31) | |||||||||||||||||||||||||||
TransparentColor |
Determines the color used for transparencies when saving a GIF, or PNG image. (PNG require version >= 2.26). Setting TransparentColor automatically sets the Transparent property to true (starting with version 2.31). Example: Image.TransparentColor = vbWhite |
|||||||||||||||||||||||||||
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 |
The X property indicates the current X (horizontal) position of the cursor on the image. Example: Image.X = 10 |
|||||||||||||||||||||||||||
Y |
The Y property indicates the current Y (vertical) position of the cursor on the image. Example: Image.Y = 10 |
ASPImage Component Methods
Method | Parameters | Return Value | Description | |||||||||
AddAnimationControl | intDelay, bolTransparent, intTransparentColor | N/A |
Adds an animation control block to the GIF animation sequence. intDelay is miliseconds to delay till the next image. (available in version >= 1.8) Image.AddAnimationControl intDelay, false, 0 |
|||||||||
AddFont | strFontFileName | True/False |
Adds a new font resource dynamically to the internal system font tables. After calling AddFont you can use the new font name in the FontName property. AddFont should only be called once per font in an application. strFontFileName may be either a .FON font resource file, a .FNT raw bitmap font file, a .TTF raw TrueType file, or a .FOT TrueType resource file. (available in version >= 2.04) if Image.AddFont ("e:\sites\pub\fonts\custom.ttf") then ... |
|||||||||
AddImage | strFileName, intX, intY | True/False | Adds a new image to the canvas using the intX and intY coordinates. | |||||||||
AddImageToAnimation | N/A | N/A |
Adds the current image to the GIF animation. StartAnimation must be called before calling AddImageToAnimation. See SaveAnimation. (available in version >= 1.8) Image.AddImageToAnimation |
|||||||||
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. Image.AddImageTransparent "d:\apps\gr3\im.jpg", 5, 12, vbWhite |
|||||||||
AngleArc | intX, intY, intRadius, dblStartDegrees, dblSweepDegrees | N/A |
The AngleArc function draws a line segment and an arc. The line segment is drawn from the current position to the beginning of the arc. The arc is drawn along the perimeter of a circle with the given radius and center. The length of the arc is defined by the given start and sweep angles. (available in version >= 1.8) Image.AngleArc 50, 60, 60, 50, 90 |
|||||||||
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. | |||||||||
BeginPath | N/A | N/A | Opens a path bracket (see EndPath and FillPath). Methods with support paths: Polyline, Polygon, PolyBezier. | |||||||||
Blur | intTimes | N/A |
Blurs image intTimes (available in version >= 2.0) Example: Image.Blur 2 |
|||||||||
BrightenImage | intDegree | N/A |
Makes the existing image appear brighter. Example: Image.BrightenImage 30 |
|||||||||
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. | |||||||||
ClearTexture | N/A | N/A | ClearTexture unloads the current texture so that future calls to TextOut and other drawing functions don't use the loaded texture any more. (available in version >= 2.25) | |||||||||
Contrast | intDegree | N/A |
Modifies the image contrast. intDegree should be -100 to 100. (available in version >= 2.0) Example: Image.Contrast 15 |
|||||||||
CreateBlackWhite | N/A | N/A | Turns the current image into a monochrome image. It is suggested that you call this method early in your image creation to allow further modifications to the image to convert to BW properly. Otherwise you may end up with a completely black picture during the final conversion. One possible solution to this is to call CreateGrayScale first and then call CreateBlackWhite. (available in version >= 2.25) | |||||||||
CreateGrayScale | N/A | N/A | Turns the current image into a Gray Scale image. (available in version >= 2.25) | |||||||||
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. | |||||||||
DarkenImage | intDegree | N/A |
Darkens the image to the intDegree Example: Image.DarkenImage 30 |
|||||||||
DoMerge | strFileName, intPercent | N/A |
Loads strFileName (full path to a BMP, or JPG file) and then merges with the existing image. The higher intPercent is to 100 the more predominant strFileName will be seen over the existing image. intPercent should be inbetween 1-99. (available in version >= 1.8) If you have problems loading an image with LoadImage, DoMerge won't work either. This function uses the same load function. So if you are not able to successfully do a merge, try loading the image first with LoadImage. If that doesn't work then use the FAQ section of this document to determine why LoadImage cannot successfully load the image. Once that works then try DoMerge. Example: DoMerge "c:\webs\shared\images\logo.jpg", 20 |
|||||||||
Emboss | N/A | N/A | Gives the current image an embossed look. | |||||||||
EndPath | N/A | N/A | Closes a path bracket (see BeginPath and FillPath). | |||||||||
Ellipse | intX1, intY1, intX2, intY2 | N/A | Ellipse draws the ellipse defined by a bounding rectangle on the image. | |||||||||
FillPath | N/A | N/A |
The FillPath function closes any open figures in the current path and fills the path's interior by using the current brush and polygon-filling mode. (available in version >= 1.8). Dim aRgnPts(5,1) |
|||||||||
FillRect | intLeft, intTop, intRight, intBottom | N/A | FillRect fills the specified rectangle on the image. | |||||||||
FishEye | intDegree | N/A |
Creates a "FishEye" effect from the current loaded image. (version 2.21 or higher) Image.FishEye 1 |
|||||||||
FlipImage | intDirection | N/A |
Flips the image Valid values for intDirection are:
|
|||||||||
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:
|
|||||||||
FrameRect | intLeft, intTop, intRight, intBottom | N/A | Draws a 1 pixel wide border around a rectangular region using the points specified. | |||||||||
GetImageFileSize | strFileName, intX, intY | N/A | Gets the dimensions of the image file strFileName (GIF, PNG, JPG and BMP supported) and returns the X,Y dimensions in intX and intX. strFileName must be a full pathname. | |||||||||
GetPixel | intX, intY | intColor | Returns the pixel color for intX, intY | |||||||||
GradientOneWay | intBeginColor, intEndColor, intDirection | N/A |
Creates a one way gradient beginning with the color intBeginColor and ending in the color specified by intEndColor. intDirection may be
|
|||||||||
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:
Example: Set Image = Server.CreateObject("AspImage.Image") |
|||||||||
LoadImage | strFileName | True/False |
Loads an existing image into the image canvas. You can load JPG, PNG and BMP files. strFileName must be a local server file, not a file located on a remote server. 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. |
|||||||||
LoadTexture | strFileName | True/False |
Loads an existing image to be used as a textured brush during calls to TextOut and other drawing functions. Not all drawing functions will use the texture so some experimentation may be necessary to get the desired effect. Use ClearTexture to unload the texture when finished. (available in version >= 2.25) Note: Textures are not applied properly to rotated (angled) text. Image.LoadTexture "d:\images\texture\bubbles.bmp" |
|||||||||
Mosaic | intX, intY | N/A |
Creates a mosaic pattern from the current image. intX and intY specify the degree to which the X and Y axis are modified. (version 2.21 or higher) Image.Mosaic 5, 1 |
|||||||||
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. | |||||||||
PolyBezier | aryPoints | N/A |
Draws one or more Bézier curves. Max of 99 points supported in a single call to PolyBezier. (available in version >= 1.8) Dim RgnPts(3,1) RgnPts(0,0) = 79 |
|||||||||
Polygon | aryPoints | N/A |
Polygon draws a series of lines on the canvas connecting the points passed in and closing the shape by drawing a line from the last point to the first point. (available in version >= 1.8) Dim RgnPts(4,1) |
|||||||||
PolyLine | aryPoints | N/A |
Polyline draws a series of lines on the canvas with the current pen. Each of the points are connected. (available in version >= 1.8) Dim RgnPts(3,1) RgnPts(0,0) = 79 |
|||||||||
Rectangle | intX1, intY1, intX2, intY2 | N/A | Creates a rectangle using the points specified. | |||||||||
Resize | intWidth, intHeight | N/A | Resizes image to intWidth, intHeight. See ResizeR also. | |||||||||
ResizeR | intWidth, intHeight | N/A | Resizes an image to intWidth, intHeight by resampling. Produces a higher quality image than the Resize method. (available in version >= 2.0) | |||||||||
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. | |||||||||
Saturation | intDegree | N/A |
Adjusts the saturation value for the image. (available in version >= 2.21) Image.Saturation 50 |
|||||||||
SaveAnimation | N/A | True/False |
Saves the current GIF animation to the file indicated by the FileName property. (available in version >= 1.8) Image.SaveAnimation |
|||||||||
SaveImage | N/A | True/False | Saves the current image canvas into the file specified in the property FileName. | |||||||||
SetPixel | intX, intY, intColor | N/A |
Set the pixel at location intX, intY to intColor. (available in version >= 1.8) for i = 10 to 50 |
|||||||||
Sharpen | intValue | N/A |
Performs a sharpen function on the image using intValue (available in version >= 2.0) Image.Sharpen 1 |
|||||||||
StartAnimation | bolLoop | N/A |
Starts an animation sequence for animated GIFs. bolLoop indicates whether the animation sequence will loop or not. (available in version >= 1.8) Image.StartAnimation true |
|||||||||
StrokeAndFillPath | N/A | N/A | Closes any open figures in a path, strokes the outline of the path by using the current pen, and fills its interior by using the current brush. (available in version >= 1.8) | |||||||||
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 |
|||||||||
Twist | intDegree | N/A |
Creates a "twist" pattern from the current image. intDegree specifies degree to which the image is twisted. (version 2.21 or higher) Note: Twist will only modify pixels from 0 ,0 through the minimum X or Y size. To have the full picture twisted X and Y must be equal. Image.Twist 50 |
|||||||||
Wave | intGraphicSize, intWaveSize | N/A |
Creates a wave effect using blocks intGraphicSize x intGraphicSize with a wave size of intWaveSize. intGraphicSize should be smaller than your graphic height and width and intWaveSize tops out around a value of 50. (available in version >= 2.0) Image.Wave 10 1 |