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 autofit after use Layermove?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

dracola

Argentina
37 Posts

Posted - Apr 01 2016 :  04:48:10  Show Profile  Reply
Everytime i use LayersMove, the view always changes, even i put autofit:=TRUE and imageenview.fit, it's doesn't change anything. Is there a way to make view always same every time i use layersmove

here some of my code :
ImageEnView1.IO.LoadFromFile('C:\Image1.Jpg');
ImageEnView1.AutoFit:=TRUE;

it's display image fit to ImageenView area

than i add layers
ImageEnView1.LayersAdd;
ImageEnView1.IO.LoadFromFile('C:\Image2.Jpg');

ImageEnView1.LayersMove(ImageEnView1.LayersMove( 0, IEN_Bring_Forward );

the display of image not autofit anymore in imageenview...
how i make the view always autofit

Thank's & best rgds

here i attach some image:

Before Layer move :





After Layer Move : The image not fit inside ImageenView


w2m

USA
1990 Posts

Posted - Apr 04 2016 :  08:41:49  Show Profile  Reply
Autofit only works with Layer 0, so try manually setting the layers position and dimensions:

var
  iLayer: integer;

iLayer := ImageEnView1.LayersAdd;
ImageEnView1.IO.LoadFromFile('C:\Image2.Jpg');
ImageEnView1.Layers[iLayer].PosX := 0;
ImageEnView1.Layers[iLayer].PosY := 0;
ImageEnView1.Layers[iLayer].Width := ImageEnView1.Layers[0].Width;
ImageEnView1.Layers[iLayer].Height := ImageEnView1.Layers[0].Height;

This should make iLayer fit to the bitmap in layer 0.

Or set LayersSync to true then all layers will be the same size and position but can not be moved or repositioned.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

dracola

Argentina
37 Posts

Posted - Apr 04 2016 :  21:07:08  Show Profile  Reply
I see...now that i know why cannot autofit
Thank's for the explanation w2m..^_^
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: