ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to make autofit after use Layermove?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
dracola Posted - Apr 01 2016 : 04:48:10
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


2   L A T E S T    R E P L I E S    (Newest First)
dracola Posted - Apr 04 2016 : 21:07:08
I see...now that i know why cannot autofit
Thank's for the explanation w2m..^_^
w2m Posted - Apr 04 2016 : 08:41:49
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