Multi page image handling

dotnetgirl

Active member
Joined
Oct 14, 2003
Messages
26
Location
India
Hello all,
i am a new beibee to this group and currently started working for a vb.net windows application. i want to handle multi page images with custom file formats inside my application. i ve a series of thumbnails to set the image frames. Can any one tell me how to go about it?

Thanks in advance.

Regards.
 
Im not sure what Multi-page images are. Do you mean Images with more than one frame like an animated GIF?
 
I dont think you will get any takers here on this topic. Look into The set of classes called CxImage. It is c++ but but if you can get someone to compile it into a dll for you, it is free.

I have not yet persued making the dll, or else I would post it.
 
Thanks for your reply.
i do mean multi frame images.
But is it the only way using C++ class, cxImage.
In .Net, there are ImageEncoder and related classes to handle the image file formats. We have Image.SaveAdd() method to add a new frame to the image. But i dont know how to go sequentially.

Any clues regarding this?
Thanks.
 
I have looked all over for what we want and found nothing that worked. If you find something, please, let me know.
 
I have used this code to save a multi frame image. I am able to extract image frames out of it. but Basic problem is with the saving.

The code is like this

Public Function saveImage(ByVal filenametoSave As String, ByVal imgs As Image())
Dim tmpImage As Bitmap
Dim myEncoder As Encoder = Encoder.SaveFlag
Dim myEncoderParameters As EncoderParameters = New EncoderParameters(1)
Dim myEncoderParameter As EncoderParameter = New EncoderParameter(myEncoder, EncoderValue.MultiFrame) (long)
myEncoderParameters.Param(0) = myEncoderParameter

to add a page I do the following:
Dim frCount As Int16 = imgs.Length, i As Int16
Dim page As Bitmap
For i = 0 To frCount
page = imgs(i)
If tmpImage Is Nothing Then
tmpImage = page
Else
tmpImage.SaveAdd(page, myEncoderParameters) Error :: GENERIC ERROR IN GDI+
End If
Next

tmpImage.Save(filenametoSave, GetEncoderInfo("image/tiff"), myEncoderParameters)
Return tmpImage
End Function


The imgs array is having image frames. I think this is logically correct. I got help regarding this on dotnet247.coms forum.

But the saveAdd() is not working. I m getting a Generic Error without any more detail.

Thanks for everybodys help.
 
I think I had the same error when I tried to do the same kind of thing and I gave up. Maybe you will break through!
 
First, Im not sure you can save a multi-image file as type Bitmap. You may need to use a Tiff or gif or something similar. Ive never tried this so I cant say that for sure.

But, heres a link to a solution. Youll have to register (its free) to view their forums. I dont want to paste the code here as it would be in bad taste (more or less stealing, since they want you to register to view answers).

I did get the multi-page Tiff to save, btw. From the looks of the answer given, youll have to add a few more params and do a little more than what youve got.

-Nerseus
 
Back
Top