ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder
ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to make thumbs match width of TImageEnMView?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

xequte

4712 Posts

Posted - Jun 07 2019 :  00:18:41  Show Profile  Reply
Width available is TImageEnView.ClientWidth

Read CurrentScrollBars to determine if vertical scrollbar is visible:

https://www.imageen.com/help/ImageEn/TImageEnMView.CurrentScrollBars.html

If visible then decrement width by scrollbar width:

https://www.imageen.com/help/ImageEn/TIEImageEnGlobalSettings.VScrollWidth.html


Example code:

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) );
end;



Nigel
Xequte Software
www.imageen.com
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: