ImageEn, unit iemview

TImageEnMView.SetThumbnailSize

TImageEnMView.SetThumbnailSize


Declaration

procedure SetThumbnailSize(Width, Height: Integer; SetImageSize: Boolean = False);


Description

Sets ThumbWidth and ThumbHeight in one step.

If SetImageSize is false, then the specified size is for thumbnail area (including border and text space) (i.e. sets ThumbWidth and ThumbHeight to the specified values).
Otherwise, if true, it specifies the size of the image only (so ThumbWidth and ThumbHeight will be set to values larger than those specified).


Demos

Demo  Demos\Multi\Multiview2\Multiview2.dpr


Examples

// Set thumbnails to 200, 150 (images within thumbnails will be smaller)
// Note: After this call: ImageEnMView1.ThumbWidth will equal 200!
ImageEnMView1.SetThumbnailSize( 200, 150, False );

// Set so images in the grid are shown at exactly 200, 150
// Note: After this call: ImageEnMView1.ThumbWidth will be greater than 200!
ImageEnMView1.SetThumbnailSize( 200, 150, True );

// Make thumbnails match the width of the TImageEnMView
procedure TForm1.ImageEnMView1Resize(Sender: TObject);
var
  w: integer;
begin
  w := ImageEnMView1.ClientWidth;
  if ImageEnMView1.CurrentScrollBars in [ ssVertical, ssBoth ] then
    dec( w, IEGlobalSettings().VScrollWidth );
  ImageEnMView1.SetThumbnailSize( w, MulDiv( w, 4, 3 ), False );
end;


See Also

 ThumbWidth
 ThumbHeight
 ThumbSizeInfo