ASP Painter
Home
Home
Samples
Samples
Purchase
Purchase
Download
Download
Documentation
Documentation


ASPPainter .NET Documentation

Quick start instruction
   Introduction
   Methods   

Quick start instruction

1. Quick start instruction to use ASPPainter .NET component

  • Install asppainternetdemo.msi
  • Run World Map Sample (Start->All Programs->ASP Painter .NET-> World Map)

2. Quick start instruction for ASP.NET developers

  • Place "asppainternet.dll" from distribution package to your virtual directory (to subdirectory bin).
  • Place "blockdiagram.aspx" from distribution package to your virtual directory
  • Open corresponding url from your browser.

3. Quick start instruction for C# developers

  • Add reference to asppainternet.dll (folder ASPPainterNet/dll) VS 2003 -> Project-> Add Reference -> Projects->Browse


Introduction

General information

Component is distributed with complete source code that can be easily extended with your own functionality (See purchase page).

Working with the component

Let us take a close look at the component internals on a simple sample.

Image Creation.

Used method: Create (width, height)

Create method allocates memory and creates image with specified image dimensions (width and height) in a special internal format. You should use SetBKColor to set a background color. By default the background is set to transparent black color. You need to select image type every time you need to import/export image to/from the component e.g. saving image to file, database or data stream.

Image format.

Used method: SetFormat (type)

Image format can be set with Format method. Type 0 sets PNG format (default), type 1- Jpeg, type 3 - GIF, type 4 -TIFF, type 5 - BMP.

Save Image

Used method: SaveToFile, SaveToDatabase, SaveToStream

Image can be saved to file, database or directly to a data stream.

Destroy image

Used method: Destroy , DestroyALL

Deletes current image and frees memory. It's necessary to call this method after using every image.


 Implemented Methods:

Method

Description

ClearBrush

Clear brush data. Cancel the brush set with SetBrush

ClearFontRectangle

Clear font rectangledata. Cancel the rectangle set with SetFontRectangle

ClearFontStyle

Clear font style. Cancel the font style set with SetFontBold, SetFontItalic and etc

ClearGradient

Clear brush data. Cancel the brush set with SetGradient

ClearRegion

Cancel the region set with SetRegion.

Copy

Copy image part

Create

Create image

Destroy

Destroy image and free allocated memory

DestroyALL

Destroy images, objects and free allocated memory

DrawArc

Draw Arc

DrawBezier

Draw Bezier lines

DrawCircle

Draw circle

DrawLine

Draw line

DrawEllipse

Draw Ellipse

DrawFilledCircle

Draw filled circle

DrawFilledEllipse

Draw filled ellipse

DrawFilledPie

Draw filled pie

DrawFilledPolygon

Draw filled polygon

DrawFilledRectangle

Draw filled rectangle

DrawPie

Draw filled arc (can be used to create pie charts)

DrawPolygon

Draw polygon

DrawRectangle

Draw rectangle

ExistFont

Check if the font exists

Fill

Color fill (changing color for another color)

GetColor

Get current color in ARGB format (FFFFFFFF - white)

GetColorAlpha

Gets the alpha channel value of active foreground color

GetColorBlue

Get blue value of current color

GetColorGreen

Get green value of current color

GetColorIndex

Get color handle

GetColorRed

Get red value of current color

GetFontHeight

Get the height of a text string

GetImageIndex

Get image handle

GetPixelAlpha

Get the value of alpha channel color component

GetPixelBlue

Get blue value for a pixel

GetPixelGreen

Get green value for a pixel

GetPixelRed

Get red value for a pixel

Height

Get image height

HorizontalFlip

Flip image horizontal

LoadVariable

Read image from database (sample 1)

LoadFile

Read image from file

LoadStream

Read image from variable

MakeThumbnail

Make a thumbnail from current image

Merge

Merge image parts

Mirror

Make a mirror image

ResizeCopy

Copy image part with resize

Rotate

Rotate image on an arbitrary angle

SaveToVaraible

Write image to database (sample 1)

SaveToFile

Write image to file

SaveToStream

Write image to variable (can be also used to write image directly to browser data stream)

SaveToVaraible

Write image to variable

SetAlignText

Set text align data

SetBKColor

Set background color. New images will be filled with current background color. The method can be used to create transparent images

SetBlendingMode

Enables/Disables alpha blending

SetBrush

Select current image as a brush

SetColor

Set foreground color

SetColorAsTransparent

Set current color as transparent. (set alpha channel value to 0)

SetColorIndex

Select color

SetFontAntialias

Set antialias font

SetFontBold

Set bold font style

SetFontGradient

Draw text using gradient fill

SetFontItalic

Set italic font style

SetFontName

Set font name. For example to "Times New Roman"

SetFontOrientation

Set angle to draw text

SetFontRectangle

Set rectangle to draw text

SetFontRegular

Set regular font style

SetFontSize

Set the size of True Type Font

SetFontStrikeout

Set strikeout font style

SetFontUnderline

Set underline font style

SetFormat

Set image format (PNG, Jpeg, BMP, GIF, TIFF)

SetGradient

Select gradient

SetImageIndex

Select image

SetJpegQuality

Set Jpeg quality value

SetLineWidth

Set line thickness for simple drawing operations

SetPixel

Set pixel

SetRegion

Set region for painting

SetSaveAsPalette

Save current image in Palette format (PNG,TIFF, BMP). GIF image is a palette one by default

SetTransparentPixel

Set transparent pixel

TextOut

Draws text with selected TrueType font

Grayscale

Convert image to Grayscale

Monochrome

Convert image to black and white

DrawUnclosedPolygon

Draw unclosed polygon (first point is not connected to the last one)

VerticalFlip

Flip image vertical

Width

Get image width

SetBlendingQuality

     Set image and text dithering quality

BlendImage

     Blend two images with alpha channel

ChangeColor

     Change a transparent color on another not transparent one

ChangeTransparentColor

     Change a transparent color on image

SetTiffColorDepth

     Set color depth for TIFF images (8,24,32)

SetTiffCompression

     Reserved for future use

SetTextLineAlign

     Align text vertically in a rectangle.

SetColorMatrix

     Set color transformation matrix

DrawColorMatrix

     Change all colors using color transformation matrix.

SetHTMLColor

     Set a color from a text variable #RRGGBB

SetPalette

     Set quality, desired dithering levels, and quantity of colors.

version 2.0

GetRealLevel

Get an average level when using Monochrome method

GetResolutionXDPI

Get a horizontal DPI

GetResolutionYDPI

Get a vertical DPI

GetTextRectangle

Get a rectangle suitable for text output

LoadVariable

Load an image from a variable

MakeClone

Make a copy of an image

Noise

Subtract one image from another

SaveToVariable

Write an image into a variable

SetInterpolationMode

Set Interpolation mode

SetLevel

Evidently, set a level for converting with Monochrome method

SetResolution

Set a resolution for DPI

SetSmoothingMode

Set Smoothing mode

SetTension

Set tension with otput by Bezier method

SetTextAlign

Set text align



home samples purchase documentation download