B
Brian Adams
I am working on an image viewer application as a learning
exercise. Obviously I am making heavy use of the Bitmap
and Image classes. In the full framework, there is a
method called Image.RotateFlip() that would allow some
trivial image manipulation. This method doesn't exist in
the Compact Framework. Unfortunately, they also removed
the LockBits method that would allow programmers to party
on the image bits themselves. The only way I have found
in the Compact Framework to rotate an image is by creating
a second image of the correct dimensions and then walking
over the first image calling GetPixel and then calling
SetPixel on the new image. This is just about the most
inefficient method of doing anything I have ever
witnessed. To rotate a simple 74x124 pixel image on a
400MHz XScale, it takes approx. 1:30 minutes. The time to
rotate an image 90 degrees appears to increase
exponentially as the image gets larger.
Does anybody have a better method of rotating an image
with the Compact Framework? If not, then I fear it will
be a big flop for the majority of applications, since
trivial image manipulation is a fairly common thing.
Especially with games!
Brian
exercise. Obviously I am making heavy use of the Bitmap
and Image classes. In the full framework, there is a
method called Image.RotateFlip() that would allow some
trivial image manipulation. This method doesn't exist in
the Compact Framework. Unfortunately, they also removed
the LockBits method that would allow programmers to party
on the image bits themselves. The only way I have found
in the Compact Framework to rotate an image is by creating
a second image of the correct dimensions and then walking
over the first image calling GetPixel and then calling
SetPixel on the new image. This is just about the most
inefficient method of doing anything I have ever
witnessed. To rotate a simple 74x124 pixel image on a
400MHz XScale, it takes approx. 1:30 minutes. The time to
rotate an image 90 degrees appears to increase
exponentially as the image gets larger.
Does anybody have a better method of rotating an image
with the Compact Framework? If not, then I fear it will
be a big flop for the majority of applications, since
trivial image manipulation is a fairly common thing.
Especially with games!
Brian