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
 Rotate and Crop UI
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Vitaly

Ukraine
4 Posts

Posted - Oct 12 2015 :  05:11:25  Show Profile  Reply
Hi,

ImageEn has a function RotateAndCrop (), it works well. I would like to make a pretty interface to it, such as in Picasa or Lightroom. I have not found anything like it in the Forum, besides

Spetric post: http://www.imageen.com/ieforum/topic.asp?TOPIC_ID=1775&SearchTerms=mask,layer

I'm newbie in ImageEn and understand how to do it without the example too hard for me.

Is there possibility to reproduce that?

Vitaly





465124

xequte

39076 Posts

Posted - Oct 12 2015 :  20:14:11  Show Profile  Reply
Hi

This should not be too difficult to do:

1. Store the image in a temporary TIEBitmap

1. Have a control such as a Trackbar that calls a timer when it changes. On the timer event copy the temporary TIEBitmap and rotate the display with the zoom level specified by the trackbar

2. Add a selection box at a position within the image content (use some math here for the best default position). Use iesoMarkOuter in SelectionOptions to mark the outer area:

http://www.imageen.com/help/TImageEnView.SelectionOptions.html

Also, you can draw a grid in the DrawBackBuffer event (similar to the method at: www.imageen.com/ieforum/topic.asp?TOPIC_ID=2237 but not at the pixel level).


An alternative way would be to have a black background and add the image in layer 1. Enable the miRotateLayers MouseInteract option.

Let us know how you go and if you have any difficulty.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

Vitaly

Ukraine
4 Posts

Posted - Oct 16 2015 :  09:05:04  Show Profile  Reply
Hi Nigel,

Thanks for the quick response.

I created a test application and I think that the RotateAndCrop() function is not really correct.

The height of the landscape cropped image is less than it possible.

I wrote my own function, and you can compare the crop results.

Rotation speed is very nice, I compared with the speed of GDI rotation function.

http://stackoverflow.com/questions/10633400/rotate-bitmap-by-real-angle

Thanx,

Vitaly.


attach/Vitaly/2015101693654_RotateAndCropPicasaLike.zip
192.2 KB
Go to Top of Page

xequte

39076 Posts

Posted - Oct 19 2015 :  20:49:22  Show Profile  Reply
Thanks Vitaly,

We will have a fix for the next update. Can I add your project as a user demo? (I will need to remove the GDI code).


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

Vitaly

Ukraine
4 Posts

Posted - Oct 20 2015 :  04:35:24  Show Profile  Reply
Hi Nigel,

Of course you can add as demo and change everything on your own.

Vitaly
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: