GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / CreateGdPictureImageFromFile Method / CreateGdPictureImageFromFile(String,Boolean,Boolean) Method
The file path of the input image file. Use the empty string to allow the control to prompt users to select a file.

You can subsequently use the GdPictureImaging.GetLastPath method to retrieve the path of the selected file.

Specifies if the document content will be loaded into memory (true). Loading the document content directly into memory results in a better manipulation performance, but it consumes more memory. If you load a file into memory, you can subsequently overwrite or delete the file.
Setting this parameter to true causes to load only image properties, metadata and an embedded thumbnail. This parameter is particularly useful when you need to only obtain image information without decoding the image itself.

Be aware that all subsequent calls to the methods requiring pixel access using this image resource will fail.






In This Topic
CreateGdPictureImageFromFile(String,Boolean,Boolean) Method
In This Topic
Creates a new GdPicture image representing the image based on an input image file. You can also specify if the file content is loaded into memory or not using this method together with enabling or disabling the direct access setting. The newly created image is identified by its unique non-zero image identifier.

Please note that it is your responsibility to release the image resources once you have no use for them.

Syntax
'Declaration
 
Public Overloads Function CreateGdPictureImageFromFile( _
   ByVal FilePath As String, _
   ByVal LoadInMemory As Boolean, _
   ByVal DirectAccess As Boolean _
) As Integer
public int CreateGdPictureImageFromFile( 
   string FilePath,
   bool LoadInMemory,
   bool DirectAccess
)
public function CreateGdPictureImageFromFile( 
    FilePath: String;
    LoadInMemory: Boolean;
    DirectAccess: Boolean
): Integer; 
public function CreateGdPictureImageFromFile( 
   FilePath : String,
   LoadInMemory : boolean,
   DirectAccess : boolean
) : int;
public: int CreateGdPictureImageFromFile( 
   string* FilePath,
   bool LoadInMemory,
   bool DirectAccess
) 
public:
int CreateGdPictureImageFromFile( 
   String^ FilePath,
   bool LoadInMemory,
   bool DirectAccess
) 

Parameters

FilePath
The file path of the input image file. Use the empty string to allow the control to prompt users to select a file.

You can subsequently use the GdPictureImaging.GetLastPath method to retrieve the path of the selected file.

LoadInMemory
Specifies if the document content will be loaded into memory (true). Loading the document content directly into memory results in a better manipulation performance, but it consumes more memory. If you load a file into memory, you can subsequently overwrite or delete the file.
DirectAccess
Setting this parameter to true causes to load only image properties, metadata and an embedded thumbnail. This parameter is particularly useful when you need to only obtain image information without decoding the image itself.

Be aware that all subsequent calls to the methods requiring pixel access using this image resource will fail.

Return Value

A unique image identifier of the GdPicture image representing the newly created image. The returned value is non-zero if the image is successfully created. Please first of all use the GdPictureImaging.GetStat method to determine if this method has been successful.

Be aware that you need to release the image resource with the GdPictureImaging.ReleaseGdPictureImage method after being used.

Remarks
It is recommend to use the GdPictureImaging.GetStat method to identify the specific reason for the method's failure, if any.

All document formats currently supported by the toolkit are listed here.

This class loads multipage images (GIF and TIFF formats) in read-write mode by default. If you want to open multipage images in read-only mode, you need to call the GdPictureImaging.GifOpenMultiFrameForWrite method for GIF format and the GdPictureImaging.TiffOpenMultiPageForWrite method for TIFF format and set the WriteAccess parameter to false before creating an image.

This method requires the Image Documents component to run.

See Also