This methods saves image data to a file
Public Function SaveImageToFile(Val As Newtone.ImageKit.SaveFileType, Url As String) As Boolean
public bool Newtone.ImageKit.SaveImageToFile(Newtone.ImageKit.SaveFileType Val, string Url) ;
Parameters
The format in which the image is to be saved. This value is of type Newtone.ImageKit.SaveFileType
Return Value
Returns True if successful. Returns False if unsuccessful.
Explanation
The SaveImageToFile method saves image data to a file.
The string set in the Url parameter determines the location where the image will be saved. This parameter uses a relative virtual path.
For example, if the image should be saved in the following
virtual path:
"http://myserver/myfolder/myimage.jpg"
Set the Url parameter as follows:
ImageKit1.Url =
"/myserver/myfolder/myimage.jpg"
Below is a list image formats and the properties that should be set when saving files in that format
FPX | The Comment property should be set. If the Val parameter is SaveFPXJpeg then the JpegQuality property should also be set. |
GIF | The Comment property should be set. |
JPEG | The Comment, JpegQuality, and JpegSubsamp properties should be set. |
JPEG Progress | The Comment, JpegQuality, and JpegSubsamp properties should be set. |
JPEG2000 | The Comment, JPEG2000CodeBlockHeight, JPEG2000CodeBlockWidth, JPEG2000NumResLevel, JPEG2000PrecinctHeight, JPEG2000PrecinctWidth, JPEG2000Reversible, JPEG2000Size, JPEG2000TileHeight, and JPEG2000TileWidth properties should be set. |
PNG | The Comment, Interlace, TransparentBlue, TransparentGreen, TransparentRed, PngAlphaChannel, and Transparent properties should be set. When the PngAlphaChannel property is True, pass the image handle of the 32 bit RGBA image to the Image property. |
TIFF | The TiffAppend property should be set. If the TiffAppend property is True, then after executing this method, be sure to execute the CloseMultiTiff method. |
With certain raster image formats, it is only possible to save
images of a particular bitcount. Errors can be generated it an
image of unsupported bitcount is saved in an image format. Below is
a list of supported bitcounts when saving each type of raster
image.
Image File Format: Supported bitcounts when saving
image
BMP(Uncompressed): 1,4,8,16,24,32 (Does not include 16 bit
grayscale)
BMP(Compressed): 4,8
JPEG(Standard DCT): 8 bit grayscale, 24 (Without the ImageKit.NET2
Win32 Plugin files, images of other bitcounts can be saved but they
will be saved as 24 bit color)
JPEG(Progressive DCT): 8 bit grayscale,24
GIF: 1,4,8 (these will be saved in 8 bit)
TIFF(Uncompressed): 1,4,8,16,24,32 (Does not include 16 bit
grayscale)
TIFF(GROUP3-1D): 1
TIFF(GROUP4): 1
TIFF(PACKBITS): 1,
TIFF(LZW): 1, 4, 8, 16, 24, 32 (Does not include 16 bit
grayscale)
PNG: 1, 4, 8, 24
FPX(Uncompressed): 8 bit grayscale, 24
FPX(Single Color Compressed): 8 bit grayscale, 24
FPX(JPEG Compression): 8 bit grayscale, 24
JPEG2000(Part1): 8 bit grayscale, 24
JPEG2000(Code Stream): 8 bit grayscale, 24
Note: The following image formats require the ImageKit.NET2 Plugin
dll files in order to be saved: BMP(Compressed),
JpegProgress, TIFF, JPEG2000, FPX.
WMF and EMF images cannot ordinarily be loaded and displayed in
.NET but rather are converted to raster images when displayed. For
that reason, even though the file extension is .emf or .wmf, the
images can only be saved as raster images.