This methods saves image data to a file

[Visual Basic]
Public Function SaveImageToFile(Val As Newtone.ImageKit.SaveFileType, Url As String) As Boolean
[C#]
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 property should be set.
TIFF To manipulate multipage tiff files, use one of the following methods: AppendTiffImage, DeletePageFromMultipageTiff, or InsertPageIntoMultipageTiff

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.NET3 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.NET3 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.  

See Also

ImageKit.File Members | Newtone.ImageKit.Win.ImageKit

The ImageKit.NET3 is created by Newtone Corporation