Click here to Skip to main content
15,920,633 members
Home / Discussions / C#
   

C#

 
GeneralRe: Another image problem Pin
Mazdak9-Jul-03 7:39
Mazdak9-Jul-03 7:39 
GeneralRe: Another image problem Pin
Mazdak9-Jul-03 8:10
Mazdak9-Jul-03 8:10 
GeneralRe: Another image problem Pin
Kastro9-Jul-03 9:09
Kastro9-Jul-03 9:09 
GeneralRe: Another image problem Pin
Mazdak9-Jul-03 11:29
Mazdak9-Jul-03 11:29 
GeneralRe: Another image problem Pin
Mazdak10-Jul-03 6:12
Mazdak10-Jul-03 6:12 
QuestionSystem.Configuration.ConfigXmlWhitespace? Pin
CBoland9-Jul-03 5:14
CBoland9-Jul-03 5:14 
GeneralMultiimage in one tiff file Pin
Mazdak9-Jul-03 4:27
Mazdak9-Jul-03 4:27 
GeneralMultiple-frame TIFF file Pin
Valeria Bogdevich9-Jul-03 4:48
Valeria Bogdevich9-Jul-03 4:48 
The following example creates three Bitmap objects: one from a BMP file, one from a JPEG file, and one from a PNG file. The code saves all three images in a single, multiple-frame TIFF file.

using System;
using System.Drawing;
using System.Drawing.Imaging;
class Example_MultiFrame
{
public static void Main()
{
Bitmap multi;
Bitmap page2;
Bitmap page3;
ImageCodecInfo myImageCodecInfo;
Encoder myEncoder;
EncoderParameter myEncoderParameter;
EncoderParameters myEncoderParameters;
// Create three Bitmap objects.
multi = new Bitmap("Shapes.bmp");
page2 = new Bitmap("Iron.jpg");
page3 = new Bitmap("House.png");
// Get an ImageCodecInfo object that represents the TIFF codec.
myImageCodecInfo = GetEncoderInfo("image/tiff");
// Create an Encoder object based on the GUID
// for the SaveFlag parameter category.
myEncoder = Encoder.SaveFlag;
// Create an EncoderParameters object.
// An EncoderParameters object has an array of EncoderParameter
// objects. In this case, there is only one
// EncoderParameter object in the array.
myEncoderParameters = new EncoderParameters(1);
// Save the first page (frame).
myEncoderParameter = new EncoderParameter(
myEncoder,
(long)EncoderValue.MultiFrame);
myEncoderParameters.Param[0] = myEncoderParameter;
multi.Save("Multiframe.tiff", myImageCodecInfo, myEncoderParameters);
// Save the second page (frame).
myEncoderParameter = new EncoderParameter(
myEncoder,
(long)EncoderValue.FrameDimensionPage);
myEncoderParameters.Param[0] = myEncoderParameter;
multi.SaveAdd(page2, myEncoderParameters);
// Save the third page (frame).
myEncoderParameter = new EncoderParameter(
myEncoder,
(long)EncoderValue.FrameDimensionPage);
myEncoderParameters.Param[0] = myEncoderParameter;
multi.SaveAdd(page3, myEncoderParameters);
// Close the multiple-frame file.
myEncoderParameter = new EncoderParameter(
myEncoder,
(long)EncoderValue.Flush);
myEncoderParameters.Param[0] = myEncoderParameter;
multi.SaveAdd(myEncoderParameters);
}
private static ImageCodecInfo GetEncoderInfo(String mimeType)
{
int j;
ImageCodecInfo[] encoders;
encoders = ImageCodecInfo.GetImageEncoders();
for(j = 0; j < encoders.Length; ++j)
{
if(encoders[j].MimeType == mimeType)
return encoders[j];
}
return null;
}
}
GeneralRe: Multiple-frame TIFF file Pin
Mazdak9-Jul-03 6:45
Mazdak9-Jul-03 6:45 
GeneralWrong characters on printing results Pin
jpeg9-Jul-03 4:15
jpeg9-Jul-03 4:15 
Generalsaving a datagrid Pin
Cristian_Dior8-Jul-03 20:57
Cristian_Dior8-Jul-03 20:57 
GeneralRe: saving a datagrid Pin
perlmunger9-Jul-03 7:21
perlmunger9-Jul-03 7:21 
GeneralRe: saving a datagrid Pin
Cristian_Dior13-Jul-03 20:37
Cristian_Dior13-Jul-03 20:37 
Generalint.ToString() format problem Pin
zecodela8-Jul-03 17:01
zecodela8-Jul-03 17:01 
GeneralRe: int.ToString() format problem Pin
Kastro8-Jul-03 17:51
Kastro8-Jul-03 17:51 
GeneralUserControl rotation Pin
meschian8-Jul-03 12:34
meschian8-Jul-03 12:34 
GeneralRe: UserControl rotation Pin
J. Dunlap8-Jul-03 12:37
J. Dunlap8-Jul-03 12:37 
GeneralImage rotation ?? Pin
azusakt8-Jul-03 23:22
azusakt8-Jul-03 23:22 
GeneralRe: Image rotation Pin
Valeria Bogdevich9-Jul-03 0:08
Valeria Bogdevich9-Jul-03 0:08 
GeneralRe: Image rotation Pin
azusakt9-Jul-03 15:35
azusakt9-Jul-03 15:35 
GeneralRe: Image rotation Pin
Valeria Bogdevich9-Jul-03 20:03
Valeria Bogdevich9-Jul-03 20:03 
GeneralUser Control Property Pin
Tym!8-Jul-03 11:08
Tym!8-Jul-03 11:08 
Generaltransparent user control issue Pin
SimonS8-Jul-03 10:43
SimonS8-Jul-03 10:43 
GeneralSerialization Question Pin
monrobot138-Jul-03 10:01
monrobot138-Jul-03 10:01 
GeneralRe: Serialization Question Pin
Kastro8-Jul-03 17:37
Kastro8-Jul-03 17:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.