Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

Hi, I want to rotate an image with an arbitrary extended angel by using this code:
Code: Select all
var iw:TImageWork; ....iw.Transform.Rotation:=0.85;

But the problem is that this component accepts only integer values. Now, is there any way to modify it in order to capable of rotating images with non-integer values? Thanks
Junior Member

Posts: 33
Joined: July 17th, 2004, 5:45 am

http://www.efg2.com/Lab/ImageProcessing ... anline.htm

It explains how you can rotate an image using real values.

Good luck!
Active Member

Posts: 7
Joined: April 3rd, 2006, 11:14 pm

### Re: A question about TImageWork.Transform.Rotation...

hadipardis wrote:Hi, I want to rotate an image with an arbitrary extended angel by using this code:
Code: Select all
var iw:TImageWork; ....iw.Transform.Rotation:=0.85;

But the problem is that this component accepts only integer values. Now, is there any way to modify it in order to capable of rotating images with non-integer values? Thanks

All properties of Transform (except BackColor and Resample) are defined as Single type. Therefore, you can assign any real value to these properties.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Yes, you are right! It accepts any real values but it doesn't perform any rotation with non-integer values! Please try the above code. 0.85 is not an integer value but if you give this componet any value between 0 and 1, you won't see any rotation. Intresting is that, your TRotateImage works good with such non-integer values but unfortunately, it has not any Resample property. In the other hand, TImageWork has resample property but it has not support real values! Now, what is your opinion? Or if you agree with me, how I can remedy this problem? I need a fast Bicubic rotation method. Thanks
Junior Member

Posts: 33
Joined: July 17th, 2004, 5:45 am

I checked it out and the function was working fine. Did you test with images in different size?

In the iwTransform unit there's a function defined as:

Code: Select all
function RotateImage(bmpDst: TBitmap;                      grSrc: TGraphic;                      Angle: Single;                     Resample: TResample = rsBilinear;                     BackColor: TColor = clDefault                    ): Boolean;

You can use also this function directly.
Kambiz

Kambiz