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
 TImageEnView.AutoSize?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

924 Posts

Posted - May 23 2013 :  08:28:51  Show Profile  Reply
Hi! Doesn't TImageEnView have something like TImage.AutoSize, which automatically fits the size of the ImageEnView1 component to the size of the contained image?

klausdoege

Germany
389 Posts

Posted - May 23 2013 :  08:41:14  Show Profile  Reply
Hello,
yes that gives it.
Try imageenview.fit;

Klaus
www.klausdoege.de
Go to Top of Page

PeterPanino

924 Posts

Posted - May 23 2013 :  08:55:09  Show Profile  Reply
No. This resizes the contained image to the size of the ImageEnView1 component. I need something which automatically fits the size of the ImageEnView1 component to the size of the contained image. Just the same as TImage.AutoSize does.
Go to Top of Page

PeterPanino

924 Posts

Posted - May 23 2013 :  09:12:23  Show Profile  Reply
As a workaround now I use:
procedure TForm1.ImageEnView1Resize(Sender: TObject);
begin
  ImageEnView1.Height := ImageEnView1.IEBitmap.Height;
  ImageEnView1.Width := ImageEnView1.IEBitmap.Width;
end;

I hope that the TImageEnView.OnResize event is triggered ALWAYS when TImageEnView internally changes the size of the IEBitmap. An AutoSize property like in TImage would be better.
Go to Top of Page

w2m

USA
1990 Posts

Posted - May 23 2013 :  09:17:57  Show Profile  Reply
ImageEnView1.IO.LoadFromFile(AFilename);
ImageEnView1.Align := alNone;
ImageEnView1.ScrollBars := ssNone;
ImageEnView1.Width := ImageEnView1.IdealComponentWidth;
ImageEnView1.Height := ImageEnView1.IdealComponentHeight;
ImageEnView1.Update;


William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: