On Fri, 11 Jan 2008 01:25:01 -0800, Steve K. <no***@nowhere.comwrote:
I accidently sent that without finishing, sorry.
What I was *going* to say is that the code below results in a single
frame
tif. In fact as soon as I rotate the page, the frame count returned by
GetFrameCount() changes from (whatever it was) to 1. It seems that
perfoming operations on a tif like this invalidates it somehow?
Ah. Well, not something I know about first-hand, but that sounds about
right. I'd guess the RotateFlip() method is just a simple helper that
basically creates a new internal image, copying the original into the new
one thereby replacing it.
I'm still reading online for various tips and tricks, but not finding too
much about specifically editing a tif like this. The only thing I can
think
of would be to pull all the frames out, perform operations, then rebuild
the
tif.
Sounds like a reasonable workaround to me. I don't view the .NET
Framework as being a full-featured image editing framework. It has some
basic functionality, but it still leaves lots of things for you to manage
manually. Assuming .NET has a way for you to generate a multi-frame image
(haven't done that myself), that seems like a better way to go.
BTW, if performance is important, you may want to avoid using RotateFlip()
in this case, given that it does generate a brand new image without any
other frames. Using RotateFlip(), you'd have to copy your original Image
so that you don't muck it up with the call to RotateFlip(), and then copy
the rotated image into the new Image you're building.
Instead, you should just use Graphics.FromImage() on the Image you're
building so that you can draw into its current frame, set the Transform
property of the Graphics so that drawing the original image into the new
one is rotated as you desire, and then just draw the original image
directly into the new one.
Pete