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.

Load method

To load an image from a file and resize it as it loads to the desired width, height and bits per pixel, use the following:

LoadResize method

Use the following properties and event to control loading an image through an OLE drag-and-drop operation:

DropFilesAllowed property

DropAutoLoad property

OnDropFile event

Use the following method to load a thumbnail (stamp image) into a bitmap from a JFIF or LEAD CMP file:

LoadStamp method

Use the following method to get information about a file before loading it:

GetFileInfo method

Then, read the following properties, which the method updates:

InfoAnimation property

InfoAnimationHeight property

InfoAnimationWidth property

InfoBits property

InfoColorSpace property

InfoCompress property

InfoFormat property

InfoHasAlpha property

InfoHeight property

InfoLayers property

InfoPage property

InfoPCDRes property

InfoSizeDisk property

InfoSizeMem property

InfoTotalPages property

InfoViewPerspective property

InfoWidth property

InfoXRes property

InfoYRes property

Use the following property to let the user see the progress when loading a bitmap:

PaintWhileLoad property

The WMFResolutionX property and WMFResolutionY property set the DPI (dots per inch) value that LEADTOOLS uses when loading WMF files.

When loading DJVU files, you can use the DJVResolution property to get or set the current display resolution used by LEADTOOLS when loading a DJVU file. The default value for this property is 96 DPI.

When loading PTOCA and AFP:PTOCA files, you can use the PTKResolution property to get or set the current display resolution used by LEADTOOLS.

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:

ProgressivePasses property

Use the following property to specify which of the available resolutions in a PCD file to load:

PCDRes property

When loading RTF files, you can use the RTFTopMarg, RTFBottomMarg, RTFRightMarg, RTFLeftMarg, RTFPaperWidth, and RTFPaperHeight properties to get or set the current value for the control options used by LEADTOOLS.

When loading HPGL files, you can use the PLTPenColor property and the PLTPenWidth property to get or set the current value for the control options used by LEADTOOLS.

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 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 method returns an error. The OnLoadInfo event occurs before the error, if the EnableLoadInfoEvent property has been set to true. (If the EnableLoadInfoEvent property is set to false, this event is not generated.) 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.)

LoadInfoBits property

LoadInfoFlags property

LoadInfoFormat property

LoadInfoHeight property

LoadInfoOffset property

LoadInfoWidth property

LoadInfoXRes property

LoadInfoYRes property

To set the file format to try first when recognizing files for loading, set the PreferredLoadFormat property.

When working with Vector files (DXF, DWG, WMF, EMF, PCT, CGM, DRW, PLT, TIF (with a DXF saved internally) and Intergraph Vector), you can use the standard loading methods, and you can modify the view port and view mode using the following:

RasterizeViewportWidth Property

RasterizeViewportHeight Property

RasterizeViewMode Property

To load a section of an image from a file into the Main Control use LoadFileTile method.

LEADTOOLS lets you set the color scheme to use when loading AutoCAD files (DXF and DWG). These files can be loaded either Black on White or White on Black. To determine the current color scheme being used by LEADTOOLS, use the AutoCADFilesColorScheme property.

Please note that the Mixed Raster Content functionality (Document/Medical) has been removed from this help file and is presented in the new LEADTOOLS Mixed Raster Content VCL object help file for the LEADMrc Control. For information on the new version 14 of the LEADTOOLS Mixed Raster Content VCL object, refer to the LEADTOOLS Mixed Raster Content VCL Object Help File.

To use the fast loading algorithm while loading LEAD ABC files, use the LoadFast property.  The fast loading algorithm provides faster loading with less image details.