ImageEn, unit ieMView

TImageEnMView.GridWidth

TImageEnMView.GridWidth

Declaration

property GridWidth: Integer;

Description

Specifies the number of images per row. This property is active only when DisplayMode is mdGrid.

Valid GridWidth values are:
Value Description
-1 Automatically adjust column count to match the component width (standard usage)
0 Only one row
1 A single column of thumbnails
>1 Number of columns (images per row), e.g. set to 3 for three vertical columns

Note:
You can center the thumbnail column(s) using ThumbnailOptionsEx
If AutoAdjustStyle = True, then setting Style will automatically set GridWidth
You can use CalcGridWidth and CalcGridHeight to determine the current display count (due to window size)
If ThumbWidth is auto-calculated (-1), then GridWidth must be >= 1.

Default: -1

Examples

// Automatically adjust the column count to match the control width
ImageEnMView1.GridWidth := -1;

// Show 5 columns of thumbnails
ImageEnMView1.GridWidth := 5;

// Show a PDF document in a 2x2 layout
const
  HORZ_COUNT = 2;
  VERT_COUNT = 2;
begin
  ImageEnMView1.LockUpdate();
  try
    ImageEnMView1.GridWidth   := -1;
    ImageEnMView1.ThumbWidth  := -1 * HORZ_COUNT;
    ImageEnMView1.ThumbHeight := -1 * VERT_COUNT;
    ImageEnMView1.ScrollBars := ssVertical;
    ImageEnMView1.LoadFromFileOnDemand( 'D:\MultiPageDoc.pdf' );
  finally
    ImageEnMView1.UnlockUpdate();
  end;
end;

See Also

DisplayMode
CalcGridWidth
CalcGridHeight