LoadImageIntoDIB  Method

Description         Load the n-th image of the format DCX, DIB, CLP, GIF, PCX, TIFF, TGA, ColorFax, WMF, EMF, PNG, CALS, PDF or JPEG into a Device Independent Bitmap (DIB). The n-th image does not apply to some file formats like BMP.

Usage                  Dib = [BiDib.]LoadImageIntoDIB FileName Image

Remarks             Dib                          LONGLONG The device independent bitmap. 0 if error occurred.

                            FileName                String              The source file name.

                            Image                     Integer             The nth image, or page number, for multi page images.  Numbering is zero based, for example:  Page 2 would be referenced as ‘1’

 

For supported image formats see FileFormat method.

Call BitmaniError method to retrieve the error code.

 

The LoadImageIntoDIB method only consolidates the several image loading methods into one method. For example, you can use this method to load TIFF, JPEG , BMP or PCX files.

You can use the GetImageFormat method to determine the image format of the specified file.

But you need the appropriate Black Ice dll that is in the SDK to load the image type.

For example: If you want to load a TIFF file with the LoadImageIntoDIB method,

you need the BiTiff.dll, because the LoadImageIntoDIB method loads a method from the BiTiff.dll. So if you want to load a TIFF file you can call LoadImageIntoDIB from BiDib.ocx or LoadTiffIntoDIB method from BiTiff.ocx. But you need the BiTiff.dll in both cases.

 

Available error codes:

LS_OK                                                                                                  0

Error codes for loading Bitmap, ColorFax, WMF, EMF and Clipboard files:

LS_INOTENOUGHMEMORY                                                           1

LS_IDCCREATEERROR                                                                    2

LS_IFILEOPENERROR                                                                      3

LS_IFILEIOERROR                                                                            4

LS_ICLIPOPENERROR                                                                     5

LS_ICLIPRECERROR                                                                        6

LS_IBITCOPYERROR                                                                        7

LS_IPARAMETERERROR                                                                 8

LS_IFILEFORMAT                                                                             9

LS_ICREATEPALETTE                                                                      10

LS_ICREATEBITMAP                                                                        11

LS_IMETAMAPMODEERROR                                                         12

LS_IINVALIDBITSPIXEL                                                                 13

LS_IFORMATNOTFOUND                                                                14

LS_IGETOBJECT                                                                                15

LS_IMETAERROR                                                                              16

LS_ILOCKMEMORY                                                                         17

LS_IDIBCOMPRESSED                                                                     18

LS_ISIZEERROR                                                                                19

LS_IREJECTPARAM                                                                          20

LS_IBADBITPIXEL                                                                            21

LS_IBADCAPIXPARAM                                                                   22

LS_IMG_PRINTERDC                                                                        23

LS_IMG_PRINTERRASTER                                                              24

LS_IMG_PRINTERAPPDC                                                                25

LS_IMG_PRINTERESC4                                                                    26

LS_IMG_PRINTERESC5                                                                    27

LS_IMG_PRINTERESC6                                                                    28

LS_IMG_CLIPBOARD                                                                       29

LS_IMG_PRINTCANCEL                                                                  30

LS_INOTHINGTODO                                                                         31

LS_IPAGENOTFOUND                                                                      32

 

Error codes for loading TIFF and CALS files:

 

LS_TNOTENOUGHMEMORY                                                          33

LS_TBADOPENMODE                                                                       34

LS_TINDEXOUTOFRANGE                                                             35

LS_TSTRIPOUTOFRANGE                                                               36

LS_TENDOFDATA                                                                             37

LS_TFILEIOERROR                                                                           38

LS_TPATHTOOLONG                                                                        39

LS_TNOTTIFFILE                                                                               40

LS_TBADTAG                                                                                     41

LS_TTOOFEWINFO                                                                            42

LS_TUNKNOWNCOMPRESSION                                                    43

LS_TCOMPRESSIONFAILED                                                           44

LS_TNOSUCHTAG                                                                             45

LS_TBADBYTEORDER                                                                     46

LS_TBADBITORDER                                                                         47

LS_TBADNUMBEROFCOLORS                                                      48

LS_TTOFEWCOLORINFO                                                                 49

LS_TNOTCALSFILE                                                                           50

LS_TNOEOFB                                                                                      51

LS_TBADEOFB                                                                                   52

LS_TBADWIDTH                                                                                53

LS_TNOJPEGDLL                                                                               54

LS_TBADJPEGDLL                                                                            55

LS_TFORMATCLIPBOARD                                                              56

LS_TOPENCLIPBOARD                                                                    57

LS_TRECEIVECLIPBOARD                                                             58

LS_TIMAGENOTREGISTERED                                                       59

LS_TNOBIDLGS                                                                                 60

 

Error codes for loading PCX and DCX files:

 

LS_PCX_BUF_ALLOC                                                                       61

LS_PCX_UNKNOWN_VERSION                                                     62

LS_PCX_UNKNOWN_ENCODING                                                 63

LS_PCX_FILEOPEN                                                                           64

LS_PCX_BITMAP                                                                               65

LS_PCX_CLIP_OPEN                                                                         66

LS_PCX_HDC                                                                                      67

LS_PCX_TOO_SPECIAL_FORMAT                                                 68

LS_PCX_BAD_PALETTE                                                                  69

LS_PCX_ERROR_GLOCK                                                                70

LS_PCX_ERROR_GALLOC                                                              71

LS_PCX_ERROR_USERFUNC                                                         72

LS_PCX_ERROR_BITMAPFORMAT                                               73

LS_PCX_ERROR_GETCLIPBOARD                                               74

LS_PCX_ERROR_READ                                                                   75

LS_PCX_ERROR_WRITE                                                                  76

LS_PCX_ERROR_IO                                                                          77

LS_PCX_ERROR_COLORSPACE                                                    78

LS_DCX_ERROR_INVALIDITEM                                                   79

LS_DCX_ERROR_BADFILETYPE                                                  80

LS_DCX_ERROR_BADOFFSET                                                       81

LS_DCX_ERROR_DISKSPACE                                                       82

LS_DCX_ERROR_DCXFULL                                                           83

LS_DCX_ERROR_DELETEFILE                                                      84

LS_DCX_ERROR_RENAMEFILE                                                    85

LS_DCX_ERROR_EMPTY                                                                86

 

Error codes for loading GIF files:

 

LS_GNOTENOUGHMEMORY                                                         87

LS_GBADOPENMODE                                                                      88

LS_GINDEXOUTOFRANGE                                                             89

LS_GENDOFDATA                                                                            90

LS_GFILEIOERROR                                                                          91

LS_GPATHTOOLONG                                                                       92

LS_GNOTGIFFILE                                                                              93

LS_GCOMPRESSIONFAILED                                                          94

LS_GBADNUMBEROFCOLORS                                                      95

LS_GCLIPOPEN                                                                                  96

 

Error codes for loading TGA files:

 

LS_TGA_ERROR_GALLOC                                                              97

LS_TGA_ERROR_GLOCK                                                                98

LS_TGA_ERROR_LALLOC                                                              99

LS_TGA_ERROR_LLOCK                                                                 100

LS_TGA_ERROR_ORIG_GALLOC                                                 101

LS_TGA_ERROR_ORIG_GLOCK                                                    102

LS_TGA_ERROR_SCAN_GALLOC                                                 103

LS_TGA_ERROR_SCAN_GLOCK                                                   104

LS_TGA_ERROR_EXT_GALLOC                                                    105

LS_TGA_ERROR_EXT_GLOCK                                                      106

LS_TGA_ERROR_EXT_SIZE                                                            107

LS_TGA_ERROR_FILLEXT                                                              108

LS_TGA_ERROR_DEV_GALLOC                                                   109

LS_TGA_ERROR_DEV_GLOCK                                                      110

LS_TGA_ERROR_STAMP_GALLOC                                              111

LS_TGA_ERROR_STAMP_GLOCK                                                 112

LS_TGA_ERROR_CORR_GALLOC                                                113

LS_TGA_ERROR_CORR_GLOCK                                                   114

LS_TGA_ERROR_FILE_CORRUPTED                                           115

LS_TGA_ERROR_NEWFILE_CORRUPTED                                  116

LS_TGA_ERROR_NOT_NEW_FORMAT                                        117

LS_TGA_ERROR_NOT_ENCODED                                                118

LS_TGA_ERROR_BITMAP                                                               119

LS_TGA_ERROR_IMAGETYPE                                                       120

LS_TGA_ERROR_NO_CLRMAP                                                      121

LS_TGA_ERROR_NO_EXTAREA                                                   122

LS_TGA_ERROR_NO_DEV                                                              123

LS_TGA_ERROR_NO_CLRCORR                                                   124

LS_TGA_ERROR_NO_STAMP                                                         125

LS_TGA_ERROR_BUF_GALLOC                                                    126

LS_TGA_ERROR_BUF_GLOCK                                                      127

LS_TGA_ERROR_CONV                                                                   128

LS_TGA_ERROR_SCANLINE_GALLOC                                       129

LS_TGA_ERROR_HDC                                                                      130

LS_TGA_ERROR_PALETTE                                                             131

LS_TGA_ERROR_SET_DIBITS                                                        132

LS_TGA_ERROR_GET_DIBITS                                                       133

LS_TGA_ERROR_CREAT_BITMAP                                                134

LS_TGA_ERROR_IO                                                                          135

LS_TGA_ERROR_DOSFILE                                                             136

 

Error codes for loading PNG files:

 

LS_PNGERR_CREATE                                                                      137

LS_PNGERR_OPEN                                                                           138

LS_PNGERR_MEMORY                                                                    139

LS_PNGERR_HANDLE                                                                     140

LS_PNGERR_READING                                                                   141

LS_PNGERR_WRITING                                                                    142

LS_PNGERR_CREATEDIBITMAP                                                   143

LS_PNGERR_GETDIBITS                                                                 144

LS_PNGERR_PALETTE                                                                     145

LS_PNGERR_BITDEPTHORALPHA                                               146

 

Error codes for loading PDF files:

 

LS_WINAPI_GETLASTERROR                                                        147

LS_INVALID_HANDLLS_VALUE                                                  148

LS_FILLS_ALREADY_EXISTS                                                        149

LS_INVALID_IMAGLS_SIZE                                                          150

LS_INVALID_BITSPERPIXEL                                                         151

LS_INVALID_STRING                                                                      152

LS_NULL_POINTER                                                                          153

LS_ZERO_BYTES_TO_WRITE                                                         154

LS_INVALID_DPI                                                                              155

LS_MEMORY_ALLOCATION_ERROR                                          156

LS_OBJECT_ALREADY_EXISTS                                                    157

LS_TOO_MANY_OBJECTS                                                               158

LS_INVALID_RESOURCLS_TYPE                                                 159

LS_INVALID_STREAM_SIZE                                                          160

LS_FILTER_NOT_SUPPORTED                                                       161

LS_NEGATIVLS_VALUE                                                                 162

LS_TEMP_DIRECTORY_ERROR                                                     163

LS_TEMPFILLS_ERROR                                                                   164

LS_INVALID_TIFF_DLL                                                                   165

LS_ENCODING_FAILED                                                                  166

LS_INVALID_JPEG_DLL                                                                  167

LS_INVALID_PARAMETER                                                            168

LS_OPEN_FILLS_ERROR                                                                 169

LS_NOT_PDF_FILE                                                                            170

LS_PDF_VERSION_NOT_SUPPORTED                                         171

LS_READ_FILLS_ERROR                                                                172

LS_ERROR_DURING_DECOMPRESSION                                    173

LS_INVALID_PALETTE                                                                    174

LS_COMPRESSION_NOT_SUPPORTED                                        175

LS_CCITT_DECODING_FAILED                                                    176

LS_INVALID_PAGLS_NUMBER                                                    177

LS_PDF_OBJECT_NOT_INITIALIZED_USLS_INITPDF             178

LS_UNSPECIFIED_ERROR                                                              179

See Also              GetImageFormat Method

Note:                   This method does not free the DIB.  Call the DropDIB Method to free up the DIB