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
 What Is The Best Way To Rotate A Small Bitmap
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Jun 15 2012 :  06:46:52  Show Profile  Reply
I have a 32-bit 16x16 bitmap in layer 0 and a 32-bit 9x9 bitmap in layer 1 in TImageENView.

What is the best way to rotate the bitmap in layer 1, 45 degrees and maintain its shape?

When I try various ways the bitmap seems like it is distorted after rotate. For example with the "windows red cancel glyph -" which looks like a red X.

William Miller

xequte

39109 Posts

Posted - Jun 15 2012 :  23:43:14  Show Profile  Reply
Hi William

Unfortunately small images do not rotate well (excluding simple 90, 180 and 270 rotates). If you can visualize an imaginary grid that overlays an image that has been rotated 45 degrees you will see that each of the original pixels is now spread over a 2x2 pixel square. Of course you can use one of the algorithms available in ImageEn to smooth that, but this will only have limited success on a tiny 9x9 bitmap.


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

w2m

USA
1990 Posts

Posted - Jun 16 2012 :  06:45:40  Show Profile  Reply
Thanks Nigel.

Do you know the smallest size that can be rotated 45 degrees sucessfully?

William Miller
Go to Top of Page

fab

1310 Posts

Posted - Jun 18 2012 :  01:41:42  Show Profile  Reply
Maybe I did not hit the problem, but have you tried other Rotate options? For example try to enable bicubic antialiasing:

ImageEnView1.Proc.Rotate(45, true, ierBicubic);
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jun 18 2012 :  04:23:14  Show Profile  Reply
Thanks Fabrizio, That seems to work a lot better than ierFast.

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