Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted
I'm not sure what Multi-page images are. Do you mean Images with more than one frame like an animated GIF?
.Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Posted

I don't 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.

C#
Posted

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 don't know how to go sequentially.

 

Any clues regarding this?

Thanks.

Posted

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.com's forum.

 

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

 

Thanks for everybody's help.

  • *Experts*
Posted

First, I'm not sure you can save a multi-image file as type Bitmap. You may need to use a Tiff or gif or something similar. I've never tried this so I can't say that for sure.

 

But, here's a link to a solution. You'll have to register (it's free) to view their forums. I don't 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, you'll have to add a few more params and do a little more than what you've got.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...