- srcFileName
- The input file name.
- destFileName
- The output file name. If the file exists, it will be overwritten. Not that the folder where destFileName to be created must exist prior of calling this method.
- format
- An RasterImageFormat that specifies the output file format.
- width
- The new width of the output file. If this value is not 0, then the output file will be resized to the width value. Use a value of 0 if you do not wish to resize the output file.
- height
- The new height of the output file. If this value is not 0, then the output file will be resized to the height value. Use a value of 0 if you do not wish to resize the output file.
- bitsPerPixel
- The output image pixel depth. Note that not all bits per pixel are available to all file formats.
- info
- A CodecsImageInfo object specifying more options for the conversion. If nothing is known about the file, pass null (Nothing in Visual Basic) for this parameter. However, if you obtained information about srcFileName through RasterCodecs.GetInformation, then you can pass the CodecsImageInfo returned from that method to the info parameter to speed up the conversion process.
Visual Basic (Declaration) | |
---|---|
Public Sub Convert( _ ByVal srcFileName As String, _ ByVal destFileName As String, _ ByVal format As RasterImageFormat, _ ByVal width As Integer, _ ByVal height As Integer, _ ByVal bitsPerPixel As Integer, _ ByVal info As CodecsImageInfo _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public void Convert( string srcFileName, string destFileName, RasterImageFormat format, int width, int height, int bitsPerPixel, CodecsImageInfo info ) |
C++/CLI | |
---|---|
public: void Convert( String^ srcFileName, String^ destFileName, RasterImageFormat format, int width, int height, int bitsPerPixel, CodecsImageInfo^ info ) |
Parameters
- srcFileName
- The input file name.
- destFileName
- The output file name. If the file exists, it will be overwritten. Not that the folder where destFileName to be created must exist prior of calling this method.
- format
- An RasterImageFormat that specifies the output file format.
- width
- The new width of the output file. If this value is not 0, then the output file will be resized to the width value. Use a value of 0 if you do not wish to resize the output file.
- height
- The new height of the output file. If this value is not 0, then the output file will be resized to the height value. Use a value of 0 if you do not wish to resize the output file.
- bitsPerPixel
- The output image pixel depth. Note that not all bits per pixel are available to all file formats.
- info
- A CodecsImageInfo object specifying more options for the conversion. If nothing is known about the file, pass null (Nothing in Visual Basic) for this parameter. However, if you obtained information about srcFileName through RasterCodecs.GetInformation, then you can pass the CodecsImageInfo returned from that method to the info parameter to speed up the conversion process.
This example will convert all the images in the source folder to JPEG images and put them in the destination folder.
Target Platforms: Microsoft .NET CF Framework 2.0, Windows Mobile 5 PocketPC, Windows Mobile 5 Smartphone, Windows Mobile 6