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
 Image rotation

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
spetric Posted - Aug 30 2014 : 14:13:24
Hi,

Is it possible somehow to rotate image without changing original width and height (using ImageEnProc)?

Similar procedure exists in IPL (iplRotate) which does not alter image size.

I've tried ImageEnProc->Rotate, but it changes image size and when used in OnMouseMove event (angle is calculated while dragging the mouse around) rotation (without any filter applied) is quite slow.

Layers rotation works really fast. I assume that layer bitmap is resized once to accept maximum rotation size (max diag w/h) and image is not permanently resized while layer is rotated with mouse. Image is resized once again after rotation is fixed.

It would be nice to have similar method for TIEBitmap. Something like sourceBitmap->RotateTo(destBitmap, angle, etc...), or ImageEnProc->Rotate(double angle, bool fixedsize, etc..)




3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 03 2014 : 19:09:23
Hi Siniša

Thanks for the explanation. Yes, I'm afraid at this time, rotations (excluding flips) in ImageEn will always cause the image dimensions to be affected.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
spetric Posted - Sep 01 2014 : 00:26:39
Hi,

In this case, image content is truncated in order to preserve original image w/h
and content scaling.

Actually, a programmer is responsible to eventually "prepare" (resize) image, prior to rotation if complete content of image needs to be preserved.

Here is an example how I'm rotating a part of image under mask. I'm using IPL, so I'll describe steps without a code:

1. Prior to rotation, a masked part of background image (OrigImage) is copied into new bitmap (RotoImage). Mask (ROI) is copied as RotoImage->AlphaChannel.

2. RotoImage is resized (content is not stretched) so that it can accommodate rotation by any angle:
NewRotoWidth = NewRotoHeight = ceil(SQRT(RotoWidth^2 + RotoHeight^2)).

3. In OnMouseMove event RotoImage is rotated by some angle and blended with background image (OrigImage). Rotation is performed without filter.

4. In OnMouseUp event, RotoImage is rotated once more using user supplied filter (fast, bicubic, etc...) and blended with original image.

So, although the content of RotoImage is truncated, with image resizing in "pre-rotational phase", only inessential part of content is truncated and image re-creation (resizing) is performed only once.

Maybe I wrote down too much details (my answer could be simple: content is truncated), but I like to specify reasons why to have such option.

TIA,
Siniša

xequte Posted - Aug 31 2014 : 19:56:40
Hi

Sorry, to clarify, when the rotation occurs what would you want to happen to the image content, truncated or stretched?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com