PDA

View Full Version : Small images are not rotated correctly.



wodzu
07-01-2006, 04:31 PM
Hello,

Did You noticed that when using Image.DrawRotate, for example


Image.DrawRotate(Form1.DXDraw1.Surface, Round(X)+(Image.Width div 2),Round(Y)+ (Image.Height div 2), Image.Width , Image.Height , 0, 0.5, 0.5, Round(Angle));

The rotated image sometimes has to much pixels, sometimes the pixels are missing :?
Any way to fix this issue?

Regards

Robert Kosek
07-01-2006, 04:48 PM
First off, double check your images are power of 2 in size, this is a important thing. Been around longer than I remember.

Secondly, depending on your screen size in relation to your image size, and any applicable zoom factors, this may be natural.

LP
07-01-2006, 08:00 PM
Robert, I don't think images need to be power of two, it's DelphiX ;)

The problem with pixels is because the rotation creates alias. Two things you can do:

1) Apply antialiasing. This will most likely solve the problem, although your resulting image will be slightly blurred.
2) Resize your image to 2x size and then draw it rotated in smaller size. This will reduce the problem, but not eliminate it.