New Active Image v5.0 - ActiveX component to create PNG, GIF, BMP, WBMP and Jpeg images on the fly.

Active Image is an ActiveX component to create PNG, GIF, BMP, WBMP and Jpeg images on the fly. The distribution package includes full source code and documentation. Active Image works with several images simultaneously, copies images parts with linear image transformations, reads and saves images to databases, files and calling program variables, supports direct output to browser data streams and much more. Active Image also has methods for drawing of geometric primitives, shapes, bars and charts, getting image information, pixel manipulation, text output with selectable fonts and angles and many others.

Platform: Windows 95/98/NT/2000/XP/2003.

The component can be used in all programs that can call ActiveX components. It includes ASP, IIS, MS Word, Access, Excel, VB.NET, C# and many others. Active Image is royalty-free for software and web site developers.

The downloadable distribution package includes:

  • ActiveImage MS Visual C++/MFC project with full source code.
  • Documentation
  • Patch for gd
  • Samples for each function
  • MS Access sample database.
  • Compiled binary ActiveImage.dll component (located in DLL directory)

Active Image Lite edition without source code (one developer seat, one server license) can be purchased for $49.95 via RegSoft secure forms here. To order by phone, call (877)-REGSOFT and tell the product ID: 66984.

You can purchase and download the component for $149.00 via RegSoft secure forms here (five developer seats, one server license). To order by phone, call (877)-REGSOFT and tell the product ID: 38207.

Active Image Enterprise edition with unlimited number of licenses can be purchased for $499 via RegSoft secure forms here. To order by phone, call (877)-REGSOFT and tell the product ID: 47776.

The demo version can be downloaded here.

Features:

  • Royalty-free for software and web site developers
  • Full support of PNG, Jpeg, BMP, GIF and WBMP image formats
  • Full source code and installation instructions
  • Simultaneous work with several images
  • Line, pixel and rectangle drawing (see full list below)
  • Text output with selectable font, font styles and angle
  • Polygon and filled polygon drawing
  • Reading/Saving images from/to databases like MS SQL sever and MS Access
  • Saving/Reading images to/from files
  • Saving/Reading images to/from variables of calling program
  • Direct image output to browser data stream
  • Setting/Retrieving image information
  • Alpha Blending and the support for alpha channels
  • Support for true color and palletized images
  • Full support for True Type fonts
  • Pie charts drawing
  • Full error and exception handling

 

 

What's new in version 5.0 (released Feb 20, 2004)

  • Important note! Although several versions of gd, freetype, libpng, zlib libraries have been released recently, we did not update the version of our component. Our component is for Windows platform unlike gd libraries. That is why we changed several parts in the source code of gd to prevent memory leak problems and crashing of the component. Although many of our ideas have been implemented in latest versions of the library, our code still differs. That's because we included these files in the final distribution.

  • Used the latest versions of libraries
      GD - http://www.boutell.com/gd/
      FREETYPE - http://www.freetype.org
      LIBPNG - http://www.libpng.org
      ZLIB - http://www.zlib.org
      JPEG LIB - ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/jpegsr6.zip

  • We also added a new version of the component called Active Image Lite. This version is intended for users who need only the component itself without source code. Thus you get the opportunity to use all functions of the component for a lower price. If you need to change Active Image license, please contact our support department.

What's new in version 4.9 (released Mar 26, 2003)

  • Added GetTextTTFRectangle, ConvertToPaletteNoAlpha, SetTextAntialias methods
  • Added following samples:
       "Get dimensions of a text string"
        "Drawing text with a shadow"
        "Drawing text without antialiasing"
       "Replacing colors and creating transparency"
       "Converting images from one image format to another"
    Samples 19,20,21,22,23.
  • Revised documentation

What's new in version 4.8 (released Jan 30, 2003)

What's new in version 4.7 (released Dec 6, 2002)

What's new in version 4.6 (released Sep 9, 2002)

  • Added BMP format. Use SetImageType 4.

What's new in version 4.5 (released Aug 6, 2002)

  • Added several new methods and new samples:
        ConvertToGray, CopyImageMerge, WriteToVariableVariant
  • Added samples:
        "Copy/resize of transparent image part and saving it to GIF and palette PNG files"
        "Using Active Image in C++"
        "Creating Thumbnails"
        "Merge Transparent Image"
        "Conversion to GrayScale"
    Samples 13,14,15,16,17.

What's new in version 4.4 (released Jul 10, 2002)

What's new in version 4.3 (released Apr 15, 2002)

  • Added GIF format. Use SetImageType 3.
  • Added more samples
  • Added a sample to work with cell phones and other WAP devices. See Graphics for WAP
  • Added ConvertToMonochromeAuto method to convert image to white and black.

What's new in version 4.2 (released Jan 17, 2002)

  • Added WBMP format for cell phones and other WAP devices. Use SetImageType 2.
  • Added Alpha blending
  • Added Transparency for palletized images
  • Added more methods for drawing text with true type fonts

Quick start instruction to use ActiveImage component

  • Register ActiveImage component on your computer (it's not necessary to have a web server). Open Start->Run dialog and type "path_to_regsvr\regsvr32.exe path_to_activeimage\ActiveImage.dll". Make sure you specify correct paths. For example, "C:\windows\regsvr32.exe C:\ActiveImage\ActiveImage.dll". You should see "ActiveImage DLL registered successfully" message.
  • Run block.vbs smaple located in samples folder. You can verify that newly created image  has appeared (the file with the image named block.png will be created in "AI" folder of drive C).
  • Sample 3 "Copying image" needs file "C:\AI\rose.jpg".
  • Sample 2 "Writing image to database". Create DSN "tonec" that will point to MS Access "tonec.mdb".
block.png
Picture 1

Quick start instruction for ASP developers

  • Create a web-site or virtual directory
  • Register ActiveImage component on your computer (it's necessary to have a Web server like IIS or PWS). Go to menu "Start", choose "Command Prompt" and change the directory to where ActiveImage component is located. Run from command line "regsvr32 ActiveImage.dll". You should see "ActiveImage DLL registered successfully" message.
  • If you have problem with registration, try to specify path before regsvr32.exe and ActiveImage component. For example, "C:\windows\regsvr32.exe C:\ActiveImage\ActiveImage.dll"
  • Place "diagram.asp" from distribution package to your virtual directory.
  • Open corresponding url from your browser.

Sample 1. Drawing pie charts and text lines of different fonts.
Diagram.vbs


Dim im
dim dat1,r1,g1,b1
Set im = CreateObject("ActiveImage.Images.1")

im.CreateImage 300,300

im.SetColor 0,255,0
im.Fill 299,299

dat = "20,45,15,9,11"
r = "255,255 ,255,0 ,0 "
g = "0 ,0,255,255 ,0"
b = "0 ,255,127,255,255"

dat1 = split(dat,",")
r1 = split(r,",")
g1 = split(g,",")
b1 = split(b,",")
x = 0

For i = 0 to 4
im.SetColor r1(i),g1(i),b1(i)
im.DrawFilledArc 150,150,160,160,(x*3.6),(dat1(i)+x)*3.6
x = x + dat1(i)
next

im.SetFont 4
im.SetColor 0,0,0
im.DrawText 20,20 , "HTTP://WWW.TONEC.COM/"
im.SetFont 0
im.SetColor 0,0,0
im.DrawText 20,40 , "HTTP://WWW.TONEC.COM/"

im.WriteToFile "C:\AI\diagram.png"

im.SetImageType 1
im.SetJpegQuality 100
im.WriteToFile "C:\AI\diagram.jpg"
im.DestroyImage
Set im = Nothing


diagram.jpg diagram.png
Picture 2. diagram.jpg (size - 29 Kb) Picture 3. diagram.png (size - 3 Kb)


Sample 2. Read from file and save to a database
Database.vbs


Dim im, rs

Set im = CreateObject("ActiveImage.Images.1")

im.ReadFromFile "C:\AI\diagram.png"

Set rs = CreateObject("adodb.recordset")
dsn = "tonec"
rs.Open "pictures", dsn, 2, 3
rs.AddNew
im.WriteToDatabase rs.Fields("Bitmap")
rs.Update
rs.Close
im.DestroyImage
Set im = nothing



Sample 3 . Single image manipulation: read image from file, find canvas dimensions, copy the part of image with linear transformations and save to Jpeg file with lowest quality.
Rose.vbs


Dim im, rs
Set im = CreateObject("ActiveImage.Images.1")
im.SetImageType 1
im.ReadFromFile "C:\AI\rose.jpg"
h = im.GetHeight
w = im.GetWidth


im.SetImage 1
im.CreateImage w/2,h/2
im.CopyImageResize 1,0,0,0,0,0,w/2,h/2,w,h
im.SetJpegQuality 25
im.WriteToFile "C:\AI\copyrose.jpg"
im.DestroyImage
im.SetImage 0
im.DestroyImage

Set im = Nothing



rose.jpg copyrose.jpg
Picture 4. rose.jpg (size - 6 Kb) Picture 5. copyrose.jpg (size - 1.6 Kb)



Implemented Methods:

Method Description
CopyImage Copy image part
CopyImageResize Copy image part with resize
CreateImage Create image
DestroyImage Destroy image and clean up the memory
DrawArc Draw Arc
DrawEllipse Draw Ellipse
DrawFilledArc Draw filled arc (can be used to create pie charts)
DrawFilledEllipse Draw filled ellipse (can be used to create charts)
DrawFilledPolygon Draw filled polygon
DrawFilledRectangle Draw filled rectangle
DrawLine Draw line
DrawPolygon Draw polygon
DrawRectangle Draw rectangle
DrawText Draw text
DrawTextAngle Draw text with angle
Fill Color fill (changing color for another color)
GetColorBlue Get blue value of current color
GetColorGreen Get green value of current color
GetColorRed Get red value of current color
GetFont Get font for text output operations
GetHeight Get image height
GetImage Get image handle
GetImageType Get image format (PNG, Jpeg)
GetInterlace returns true if image is interlaced
GetJpegQuality Get Jpeg quality value
GetLineThickness Get current line thickness (used in DrawLine, etc)
GetPixelBlue Get blue value for a pixel
GetPixelGreen Get green value for a pixel
GetPixelRed Get red value for a pixel
GetTransparent Returns current transparent color
GetWidth Get image width
ReadFromDatabase Read image from database
ReadFromFile Read image from file
ReadFromVariable Read image from variable
SetColor Set foreground color
SetFont Select current font
SetImage Select active image
SetImageType Set image format (PNG, Jpeg)
SetJpegQuality Set Jpeg quality value
SetLineThickness Set line thickness for simple draw operations
SetPixel Set pixel
SetTransparent Set transparent color
WriteToDatabase Write image to database
WriteToFile Write image to file
WriteToVariable Write image to variable (can be also used to write image directly to browser data stream)

New Since v4.2

ConvertToPalette Converts TrueColor image to palletized one
CreateImagePalette Creates Palette (256 color table)
ConvertToMonochromeAuto Converts image to black and white one
DrawTextTTF Draws text with selected TrueType font
DrawTextAngleTTF Draws text with selected angle and TrueType font
GetColorAlpha Gets the alpha channel value of active foreground color
GetColorTotal Returns total number of colors used. Works only for palletized images
GetPixelAlpha Gets the value of alpha channel component of the color
GetTrueColor Returns true if image is in TrueColor
SetAlphaColor Sets color with alpha channel component. For palletized image any non-zero value will result in setting this color as transparent.
SetAlphaBlending Enables/Disables alpha blending
SetColorByIndex Sets color from already created color table (palette)
SetFontPathTTF Sets path to TrueType font directory
SetFontPathTTFAuto Sets path to TrueType font automatically
SetFontSizeTTF Sets true type font size
SetSaveAlpha Enables/Disables saving alpha channel color information

New Since v4.5

ConvertToGray Converts image to Grayscale
CopyImageMerge Copy image part with resize and merge
WriteToVariableVariant   Write image to variable (can be also used to write image to OleLoadPicture in VC++)

New Since v4.7

CopyImageRotate Rotate source image and copy to a new image.
CopyImageSimpleRotate Rotate source image and copy to a new image.
DestroyAll Destroy images and free allocated memory

New Since v4.9

GetTextTTFRectangle Get text string dimensions.
ConvertToPaletteNoAlpha Converts TrueColor image to palletized one without alpha channel.
SetTextAntialias Sets text antialiasing for palette images




For more information you may take a look at the manual.

Source code compilation instructions (not needed for most users)

If you want to build the component from the source code:

  • Install all required libraries
       ZLIB
       LIBPNG
       FreeType
       JPEG LIB
       GD LIB
  • Change the following line in stdaxf.h
    // Include ADO Interface/Class Descriptions (ADO 1.5 Version) #import "c:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename( "EOF", "adoEOF" )
    if "msado15.dll" is located in different directory.
  • Build project
  • Sample 3 "Copying image" needs file "C:\AI\rose.jpg".
  • Sample 2 "Writing image to database". Create DSN "tonec" that will point to MS Access "tonec.mdb".


Note that Tonec Inc. also provides custom programming and cost-effective offshore software development services. Check out our Free Products page.

If you have any questions or bug reports, write to active.image@tonec.com for technical support.