Available in the LEADTOOLS Imaging toolkit. |
Loading a Bitmap from a File
Use the following method to load a file into a bitmap. In most cases, this method is all you need to load a file. Other methods and properties listed in this topic are for optional features and special cases.
To load an image from a file and resize it as it is being loaded to the desired width, height and bits per pixel, use the following method:
To load a file asynchronously from an Internet URL or local pathname, refer to Implementing Internet Features.
Use the following properties and event to control loading an image through an OLE drag-and-drop operation:
Use the following method to load a thumbnail (stamp image) into a bitmap from a JFIF or LEAD CMP file:
Use the following method to get information about a file before loading it:
Then, read the following properties, which the method updates:
Use the following property to let the user see the progress when loading a bitmap:
When loading multi-page files, the FilePageLoaded event is fired for each page loaded, only if the EnableFilePageLoadedEvent property has been set to TRUE. The FilePageLoaded event can be used to store or get information about individual pages of the multi-page file.
Bitmap data can be signed or unsigned. If the bitmap data is signed, the image processing and paint methods may not work correctly. A bitmap will not be loaded signed unless the LoadSigned property is set to TRUE before loading the image. For more information on this, refer to Examining and Altering Bitmaps.
Use the following property to specify the number of paint-while-load passes when the file is a progressive LEAD or JPEG file, or when it is an interlaced PNG file:
Use the following property to specify which of the available resolutions in a PCD file to load:
For PCD and FlashPix files, additional methods and properties are described in Implementing PhotoCD and FlashPix Features.
Use the following property to let a bitmap with a rotated view perspective keep its internal orientation when it is loaded.
LoadUseViewPerspective property
Use the following property to indicates whether to load 1-bit images images compressed or uncompressed:
Use the following properties, if necessary, to supply format information about the image data that is being loaded. You can use this feature for loading input data (such as raw fax) that LEADTOOLS cannot recognize. When loading an image from a file, LEADTOOLS normally determines the file format from the file header, and if the format is unrecognized, the function returns an error. The LoadInfo event occurs before the error, and you can set these properties in that event (or anywhere else in your program) to supply the missing format information and prevent the error. (LEADTOOLS checks for a non-zero value in the LoadInfoFormat property, but to implement this feature, you need to set all of the properties to appropriate values.)
To set the file format to try first when recognizing files for loading, set the PreferredLoadFormat property.