~~Title: Loading Bitmap Images (the "bitmap method")~~ If your plugin specifies either the **DVPFIF_CanReturnBitmap** or **DVPFIF_CanReturnThumbnail** flags for an individual file in the call to one of the identification functions, then Directory Opus will call your exported [[.loading_bitmap_images_the_bitmap_method:dvp_loadbitmap|DVP_LoadBitmap]] function to actually generate the bitmap image. Additionally, if the file resides on an FTP site or within a ZIP file, and you specified the **DVPFIF_CanHandleStreams** plugin flag, Directory Opus will call your [[.loading_bitmap_images_the_bitmap_method:dvp_loadbitmapstream|DVP_LoadBitmapStream]] function to generate the bitmap image from a data stream. In both cases, Directory Opus will call your function with the name of the file to load (and the data stream pointer, if applicable), along with the **VIEWERPLUGINFILEINFO** structure that you returned from the [[.file_identification:dvp_identifyfile|DVP_IdentifyFile]] function. This allows your [[.loading_bitmap_images_the_bitmap_method:dvp_loadbitmap|DVP_LoadBitmap]] function to access the information that you provided in the identification phase, which may make it easier for you to load the image. You can also use the **dwPrivateData** field of this structure to pass your own user-defined data between your identification and load functions. * [[.loading_bitmap_images_the_bitmap_method:dvp_loadbitmap|DVP_LoadBitmap]] - load a bitmap from a disk file * [[.loading_bitmap_images_the_bitmap_method:dvp_loadbitmapstream|DVP_LoadBitmapStream]] - load a bitmap from a data stream Note that there may be some fields and flags in the **VIEWERPLUGINFILEINFO** structure that you are not able to set in the [[.file_identification:dvp_identifyfile|DVP_IdentifyFile]] function - if so, you should try to set them in the call to [[.loading_bitmap_images_the_bitmap_method:dvp_loadbitmap|DVP_LoadBitmap]] instead. As well as returning an **HBITMAP** from these functions, you also have the option to return a raw JPEG or PNG data stream. In this case, Opus will decode the image data itself. This lets you write a plugin that extracts JPEG or PNG image data from a given file format without having to have decoders for those image formats linked to your plugin. To return a JPEG or PNG stream, you must allocate a block of memory using **LocalAlloc(LMEM_FIXED)** and copy the image data into it. You should then ensure that you have set either the **DVPFIF_JPEGStream** or **DVPFIF_PNGStream** flag in the **VIEWERPLUGINFILEINFO** structure. Finally, case the memory pointer to an **HBITMAP** and return it to Opus.