dotnetgirl Posted October 14, 2003 Posted October 14, 2003 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. Quote
AndreRyan Posted October 14, 2003 Posted October 14, 2003 I'm not sure what Multi-page images are. Do you mean Images with more than one frame like an animated GIF? Quote .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?
aewarnick Posted October 14, 2003 Posted October 14, 2003 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. Quote C#
dotnetgirl Posted October 17, 2003 Author Posted October 17, 2003 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. Quote
aewarnick Posted October 18, 2003 Posted October 18, 2003 I have looked all over for what we want and found nothing that worked. If you find something, please, let me know. Quote C#
dotnetgirl Posted October 20, 2003 Author Posted October 20, 2003 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. Quote
aewarnick Posted October 20, 2003 Posted October 20, 2003 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! Quote C#
*Experts* Nerseus Posted October 21, 2003 *Experts* Posted October 21, 2003 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 Quote "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
aewarnick Posted October 21, 2003 Posted October 21, 2003 Thanks Nerseus! I have been looking for something like this for a long time! Quote C#
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.