views:

2051

answers:

2

Is there a fast way to rotate images in .NET Compact Framework.

I've found ways to do 90, 180,270, rotations but would like to be able to rotate images free form in similar speed.

+1  A: 

90-, 180- or 270-degrees rotations require no calculation at all, only moving some data. On the other hand, free-angle rotations require heavy calculations. So this will never ba as fast as right-angle rotations...

Thomas Levesque
That's not necessarily true: for example if the results of the rotation can be precalculated and cached, then a rotate might just be a bitblt of the precacluated rotation from cache; or, for example, if writing to video takes more time than anything, then doing the caculation in RAM (as opposed to using the video APIs) and then bitblitting might be only imperceptably slower.
ChrisW
A: 

You can use OpenNetCF's ImageUtil class to do this (it's the "Rotate" method you're looking for). The method takes the bitmap and a (float) angle as parameters. Find the specs here:

http://www.opennetcf.com/library/sdf/html/eb32a9ba-c1dc-7194-bd31-a5d035790a45.htm

Sebastian
You almost had me. See same link. It's tough."Amount of degrees to rotate image by. Must be 90, 180, or 270"
CJCraft.com