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
 Layers [Resize, Rotate].
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  09:38:26  Show Profile  Reply
Hi William

I need your help to test Layers [Resize, Rotate] please.

1 - Add Background Picture.
2 - Add Layer Picture.
3 - Resize Layer.

// Here the problem occurs, the Layer Image is stretched.
4 - Rotate layer.

Have a Great Day

w2m

USA
1990 Posts

Posted - Mar 16 2015 :  09:54:23  Show Profile  Reply
I do not have that problem here. Can you make a small demo that reveals the problem. Without seeing code I can not help.

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

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  10:03:40  Show Profile  Reply
Hello William

Please Use RotateLayers / DEMO.

I've added 3 photos.

1 - Background with layer
2 - Resize Layer
3 - Rotate Layer (Here Stretch).

I have added the photos I'm using you can send me
this demo compiled to suporte@fotobrazil.com.br

it may be the version of Delphi

Thank you William.













Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 16 2015 :  10:07:53  Show Profile  Reply
I am not sure I understand what the problem is. If you mean the layer dimensions change when rotating a layer then yes, it has to accommodate the rotated image. Please explain.

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

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  10:11:05  Show Profile  Reply
Thanks William

Exactly, the Image Size, Are Changing.

You know how to solve this?

Kind Regards.
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  10:14:42  Show Profile  Reply
William

When I use ImageenView1.LayersFixSizes() Cause Loss of Quality.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 16 2015 :  10:45:55  Show Profile  Reply
With your images here in the demo all I see is that when you select Rotate, the image is stretched to fit the layer. So when you rotate the image is not proportional anymore. To fix this do not force the alt key or you can not make the image proportional again after rotating. Change this:
procedure Tfmain.FormActivate(Sender: TObject);
begin
  ImageEnView1.SetLayersGripStyle(clBlack,clLime,bsSolid,5,iegsCircle);
  //ImageEnView1.ForceALTkey:=true; // aspect ratio
  ImageEnView1.Blank;
  ImageEnView1.LayersSync := false;
  ImageEnView1.MouseInteract := [miMoveLayers, miResizeLayers];
  ImageEnView1.LayersResizeAspectRatio := iearALTKey;
  ImageEnView1.SelectionOptions := ImageEnView1.SelectionOptions +
    [iesoSelectTranspLayers];
  ImageEnMView1.SetModernStyling;
  // Center thumbnails
  ImageEnMView1.ThumbnailOptionsEx := ImageEnMView1.ThumbnailOptionsEx + [ietxCenterThumbnailColumn];

  cmbPreviewQuality.ItemIndex := 0;
  cmbPreviewQualityChange(nil);

  RefreshControls;
  RefreshLayerViewer;
end;

Now after rotating the image, you can resize the layer to set the correct proportion. If you do not do this the proportion of the rotated image can not be fixed. So when you need to resize with proportional press and hold the ALT key. When you want to resize the layer without proportion (to adjust the aspect ratio of the layer to look better just resize the layer without holding down the ALT key.

so the steps would be
1. Rotate the turtle layer.
2. Resize the turtle to be proportional without ALT.
3. If you want the turtle layer to be bigger after rotate press and hold the ALT key to resize the layer proportionally.

When rotating the image is resized. you can not change this I don't think, but you can fix it after you rotate.

Nice turtle!!!

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

w2m

USA
1990 Posts

Posted - Mar 16 2015 :  10:52:29  Show Profile  Reply
I am curious... Did you extract the turtle (with the white background) from the photo with ImageEn or did you use another app to do that?

If you used ImageEn, how did you extract the turtle? Note the turtles left front flipper is missing....

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

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  11:04:20  Show Profile  Reply
Hello William.

Thanks for everything.

But unfortunately the Code does not work.
For First I resize the layer and then I Rotate Layer.

I extracted the Turtle with Photoshop :)

Kind Regards.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 16 2015 :  11:07:21  Show Profile  Reply
What do you mean the code does not work? It works here perfectly. You can resize, rotate and reset the aspect ratio of the layer with no problem.

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

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  11:08:46  Show Profile  Reply
William
I Do ChromaKey with This Picture.
It is a photo mount with 3 layers, so I do not need the full turtle image.

Kind Regards.

Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  11:11:09  Show Profile  Reply
I'll test it again

Many Thanks.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 16 2015 :  11:15:34  Show Profile  Reply
After you test it again and it is not correct, attach a screen shot of the final image to show me what is wrong. So far, none of your images show any rotation at all so it is hard to figure out what you are doing.

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

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  11:16:34  Show Profile  Reply
William.

I Will Cry.

Me not work, Look Image in Annex

When I click on Rotate Button.

Turtle layer has been resized :(-

Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 16 2015 :  11:21:38  Show Profile  Reply
Yes I know... like I said the image is stretched to fit the layer dimensions... There is no fix for this. At this point to fix it, unclick rotate then resize the layer to the dimensions you want it to be. It has to be done in two steps.
1. Rotate the image.
2. Resize the layer to the correct proportion.

My code does not change how Rotate works... it just lets you fix the problem after you rotate.

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

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  11:28:26  Show Profile  Reply
William.

Thank you I will search for another way.
to solve this.

I'm sorry to bother you.

If you want to test here.

Team Viewer
ID: 723452046
Pass: 2s1v3b

Have a Great Day

Kind Regards.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 16 2015 :  11:28:37  Show Profile  Reply
Here is a screen shot that shows the unfixed turtle on the left and the fixed turtle on the right... It does work!


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

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  11:31:37  Show Profile  Reply
You Have Team Viewer?

Access the My Computer please.

Many Thanks.
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  11:36:27  Show Profile  Reply
William
please post here your demo to download.

Many Thanks
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 16 2015 :  11:38:35  Show Profile  Reply
There is no need to post the demo as I did not change anything but this:

procedure Tfmain.FormActivate(Sender: TObject);
begin
  ImageEnView1.SetLayersGripStyle(clBlack,clLime,bsSolid,5,iegsCircle);
  //ImageEnView1.ForceALTkey:=true; // aspect ratio
  ImageEnView1.Blank;
  ImageEnView1.LayersSync := false;
  ImageEnView1.MouseInteract := [miMoveLayers, miResizeLayers];
  ImageEnView1.LayersResizeAspectRatio := iearALTKey;
  ImageEnView1.SelectionOptions := ImageEnView1.SelectionOptions +
    [iesoSelectTranspLayers];
  ImageEnMView1.SetModernStyling;
  // Center thumbnails
  ImageEnMView1.ThumbnailOptionsEx := ImageEnMView1.ThumbnailOptionsEx + [ietxCenterThumbnailColumn];

  cmbPreviewQuality.ItemIndex := 0;
  cmbPreviewQualityChange(nil);

  RefreshControls;
  RefreshLayerViewer;
end;

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

wesleybobato

Brazil
367 Posts

Posted - Mar 16 2015 :  11:44:36  Show Profile  Reply
William.

Many Thanks.

Kind Regards.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: