A question about TImageWork.Transform.Rotation...

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

A question about TImageWork.Transform.Rotation...

Postby hadipardis » April 5th, 2006, 11:20 am

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
hadipardis
Junior Member
Junior Member
 
Posts: 33
Joined: July 17th, 2004, 5:45 am

Postby BadJoker » April 5th, 2006, 11:35 am

Maybe this will help you:

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

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

Good luck!
BadJoker
Active Member
Active Member
 
Posts: 7
Joined: April 3rd, 2006, 11:14 pm

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

Postby Kambiz » April 5th, 2006, 12:24 pm

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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby hadipardis » April 6th, 2006, 10:20 am

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
hadipardis
Junior Member
Junior Member
 
Posts: 33
Joined: July 17th, 2004, 5:45 am

Postby Kambiz » April 6th, 2006, 11:08 am

I checked it out and the function was working fine. :roll: 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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 2 guests

cron