TIECustomMultiBitmap.DrawToBitmap
Declaration
procedure DrawToBitmap(Dest: TIEBitmap; ThumbWidth, ThumbHeight: integer; ColCount: Integer; RowCount: Integer = -1;
CellSpacing: Integer = 6; ImageMargin: Integer = 12; CellBorder: Boolean = True; BorderColor: TColor = clBlack;
BackgroundColor: TColor = clWhite; ClipImages: Boolean = False;
DrawText: Boolean = False; PrintSelectedOnly: Boolean = False);
Description
Outputs all images as rows and columns of thumbnails to a file (this is a simplified variant of
PrintImagesToBitmap).
| Parameter | Description |
| Dest | The destination bitmap for these thumbnails. If PageNo is not set, then only the first page will be output. Dest can be nil to return the count of pages |
| ThumbWidth/ThumbHeight | The size to draw each thumbnail (in pixels) |
| ColCount | Specifies how many thumbnails span across the page |
| RowCount | Specifies how many thumbnails span down the page. This is a maximum value. The image is truncated if there are insufficent images. Specify -1 to auto-calculate based on the image count |
| CellSpacing | The spacing between the thumbnails (in pixels) |
| ImageMargin | The space on the sides of the image where thumbnails are not drawn (in pixels) |
| CellBorder | Set to true to draw a box around the each image cell (space containing the area of the image and its text) |
| BorderColor | Specifies the color of the box around the image or cell (i.e. when CellBorder is True) |
| BackgroundColor | Specifies the underlying color of the image |
| ClipImages | Set to display images cropped to the ratio of the output (i.e. left/right or top/bottom of the image will be discarded to avoid space around the thumbnail |
| DrawText | Set to true to draw text associated with every image. Note: The font of the text will be used, e.g. BottomTextFont |
| PrintSelectedOnly | If the MultiBitmap is attached to a TImageEnMView, set to true to print only selected images (otherwise all images are printed ) |
Note:
◼The image size will be calculated based on the row/column count, thumbnail size and cell spacing and margin. To output by image size only, use
PrintImagesToBitmap
◼When RowCount is -1, the count may be truncated if the created image will be too large
◼An exception is raised if there are no images to be output
Demo
| Demos\ImageEditing\EveryMethod\EveryMethod.dpr |
Examples
// Show all thumbnails in a TImageEnView
mbmp := TIEMultiBitmap.Create();
mbmp.FillFromDirectory( 'C:\Images' );
mbmp.DrawToBitmap( ImageEnView1.IEBitmap, 200, 200, 10, -1, 6, 12, True, clSilver, clWhite, True );
ImageEnView1.Update(); // Show changes in the viewer
mbmp.Free();
// Create a photo collage from the selected images in a TImageEnMView
bmp := TIEBitmap.Create();
ImageEnMView1.IEMBitmap.DrawToBitmap( bmp, 90, 90, 7, 4, 0, 0, False, clBlack, clWhite, True, False, True );
bmp.SaveToFile( 'D:\PhotoCollage.jpg' );
bmp.Free();

See Also
◼PrintImagesToBitmap
◼PrintImagesToFile