virtual L_INT LBitmap::Picturize(pszDirName, uFlags, nCellWidth, nCellHeight)
Replaces the class object's current image with an image created using images present in the specified directory.
Character string containing the directory that contains the images. Only images from this directory will be used. Images in any subdirectories will NOT be used.
Flag that indicates the behavior of the process. Possible values are given below. These values can be combined using OR ( | ) or +.
|PICTURIZE_LOADALL|| load all the pages in memory first. This causes a big improvement in the speed of the process. It is recommended to use it if you have enough memory to hold all the images|
|PICTURIZE_RESIZE|| resize the images that are not nCellWidth x nCellHeight using normal resize|
|PICTURIZE_RESAMPLE|| Resample the images that are not the required size (nCellWidth x nCellHeight). (slower process, better quality)|
|PICTURIZE_ONCE|| Use the image only once throughout the process.|
|PICTURIZE_EQUALUSAGE|| Use all images equally. That is, before an image will be used twice, all other images must be used at least once.|
|PICTURIZE_BESTFIT|| Images will be resized to fit the image if the bitmap width or height is not a multiple of nCellWidth/nCellHeight.|
|0||The picturize process will not use any of the above flags. It will: reload all the files each time you look for a rectangle to substitute and ignore all the images present in pszDirectory if their size is not nCellWidth x nCellHeight|
Width of the images used to reconstruct the image.
Height of the images used to reconstruct the image.
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
The image, or selected region, is broken down into rectangles of size nCellWidth x nCellHeight. For each rectangle, the image in the directory that is best suited to replace that rectangle is inserted into the original image.
The bitmap object is updated only once for every row of lines, where each line has a height dimension of nCellHeight. Therefore, the LBitmap::PicturizeCallBack() can be overridden to show the progress of every cell. For more information, refer to the LBitmap::PicturizeCallBack callback function.
If a region is selected, only the selected region will be changed by this function. If no region is selected, the whole image will be processed.
On an 8 BPP display, it is recommended that you create a fixed palette before you start the picturize process and use it to paint all the bitmaps. All the bitmaps which will be passed to the LBitmap::PicturizeCallBack callback will be 24BPP so a fixed palette is best. It is faster to create the palette before you start painting rather than creating it every time you paint a little square.
PICTURIZE_ONCE and PICTURIZE_EQUALUSAGE flags cannot be combined in the uFlags parameter.
If PICTURIZE_BESTFIT is set, then nCellWidth and nCellHeight are used as a starting point for the actual cell size. The cell sizes are modified so that the size of the last rectangle in a row or column differs from the other rectangles by one. Note that the cell width and height are chosen to be smaller than nCellWidth and nCellHeight. For example, if the bitmap is 101x131 and you pass 32 for the cell width and height and set PICTURIZE_BESTFIT, then the actual cell size will be 25x32. The widths of the cells will be 26, 25, 25, 25 (for a total of 101). The heights of the rows will be 33, 33, 33, 32 (for a total of 131). This option should be used if the bitmap width and height are not multiples of nCellWidth and nCellHeight.
If the bitmap width and height are not multiples of nCellWidth and nCellHeight and PICTURIZE_BESTFIT is not passed, then the last rectangle in a row or column might be very small. Using the example given above, if PICTURIZE_BESTFIT is not set, the widths of the cells would be 32, 32, 32, 5 and the heights would be 32, 32, 32, 32, 3.
PICTURIZE_EQUALUSAGE and PICTURIZE_ONCE will reduce the number of times a bitmap is used by this function.
When PICTURIZE_ONCE is set, the function will try not to use the same bitmap twice. Note that if there are not enough images, the function will return the ERROR_NOT_ENOUGH_IMAGES code if this flag is set.
When PICTURIZE_EQUALUSAGE is set, the function will use the same image more than once only if it is necessary to successfully complete the picturize process. If PICTURIZE_EQUALUSAGE is set, then for any bitmap, the number of times it is used differs from the number of times another bitmap is used by at most one. Therefore, most bitmaps will be used n times, but some bitmaps that will be used n+1 times.
This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.
This function does not support 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.
Picturize the bitmap in pBitmap
nRet =LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")), 0,ORDER_BGR);
MAKE_IMAGE_PATH(TEXT("")), // a directory containing images
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries