473,324 Members | 2,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to Merge 2 JPEG files into one file.

Hi,

I have two JPEG Images. Now I wanted to merge them into one image. I am
trying to use Image.SaveAdd to do this. But it is throwing an exception
"Invalid parameter used."

Following is the code:
Image mapImage = Image.FromFile (filename);
Image legendImage = Image.FromFile (filename2);
EncoderParameters parameters = new EncoderParameters(1);

parameters.Param[0] = new EncoderParameter( Encoder.SaveFlag,
(long)EncoderValue.MultiFrame);
mapImage.SaveAdd( legendImage, parameters );

Can any one tell me what parameter should I use ?

Thanking you in Anticipation
Regards
Imtiaz

Nov 16 '05 #1
2 18028
GIFs can be animated, but JPEGs cannot, so a multiframe JPEG is invalid.

"Imtiaz" <Im****@discussions.microsoft.com> schrieb im Newsbeitrag
news:F7**********************************@microsof t.com...
Hi,

I have two JPEG Images. Now I wanted to merge them into one image. I am
trying to use Image.SaveAdd to do this. But it is throwing an exception
"Invalid parameter used."

Following is the code:
Image mapImage = Image.FromFile (filename);
Image legendImage = Image.FromFile (filename2);
EncoderParameters parameters = new EncoderParameters(1);

parameters.Param[0] = new EncoderParameter( Encoder.SaveFlag,
(long)EncoderValue.MultiFrame);
mapImage.SaveAdd( legendImage, parameters );

Can any one tell me what parameter should I use ?

Thanking you in Anticipation
Regards
Imtiaz

Nov 16 '05 #2
cody wrote:
GIFs can be animated, but JPEGs cannot, so a multiframe JPEG is
invalid.

But note: the .Net framework (at least up to version 1.1) can't generate
animated gif's. The "MultiFrame" is provided for tiff files that can store multiple
images in a single file, with no amination support. (for one thing: it's not possible
to define timing).

Hans Kesting

"Imtiaz" <Im****@discussions.microsoft.com> schrieb im Newsbeitrag
news:F7**********************************@microsof t.com...
Hi,

I have two JPEG Images. Now I wanted to merge them into one image.
I am trying to use Image.SaveAdd to do this. But it is throwing an
exception "Invalid parameter used."

Following is the code:
Image mapImage = Image.FromFile (filename);
Image legendImage = Image.FromFile (filename2);
EncoderParameters parameters = new EncoderParameters(1);

parameters.Param[0] = new EncoderParameter( Encoder.SaveFlag,
(long)EncoderValue.MultiFrame);
mapImage.SaveAdd( legendImage, parameters );

Can any one tell me what parameter should I use ?

Thanking you in Anticipation
Regards
Imtiaz

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve Holden | last post by:
If nobody has a quick answer I'll go to the PIL list, but I'm having problems with PIL JPEG support on Windows, and figured someone on c.l.py might have solved this problem. I built the Cygwin...
0
by: frankenberry | last post by:
I have multi-page tiff files. I need to extract individual frames from the multi-page tiffs and save them as single-page tiffs. 95% of the time I receive multi-page tiffs containing 1 or more black...
16
by: David Lauberts | last post by:
Hi Wonder if someone has some words of wisdom. I have a access 2002 form that contains 2 graph objects that overlay each other and would like to export them as a JPEG to use in a presentation....
8
by: Squirrel | last post by:
Hi everyone, I've created a mail merge Word doc. (using Office XP) , the data source is an Access query. Functionality I'm attempting to set up is: User sets a boolean field to true for...
0
by: Johann Blake | last post by:
In my need to decode a JPEG 2000 file, I discovered like many that there was no functionality for this in the .NET Framework. Instead of forking out a pile of cash to do this, I came up with the...
9
by: Tim | last post by:
Since rtf files cause so many troubles, i.e., allow the users to download the files, slow loading, incompatible with other browser, and so on. Do you think I should convert them to JPEG files to...
10
by: rtilley | last post by:
Hope it's not inappropriate to post this here. Could someone critique my code? I have no Python programmers in my office to show this to. The script works OK, but should I do it differently? I...
0
by: Jack Wu | last post by:
Hi I've spent a good majority of my day trying to figure out how to have PIL 1.1.5 working on my OSX 10.3.9_PPC machine. I'm still stuck and I have not gotten anywhere. Could somebody please...
1
by: cristalink | last post by:
Hi, I have MS Visual Studio 2008 both Pro and Dev Team Edition SP1 installed. I've compiled a managed C++ .DLL which automatically had a manifest embedded, with the following dependency:...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.