Click here to Skip to main content
15,895,142 members
Home / Discussions / C#
   

C#

 
AnswerRe: I have some questions in C# Pin
Luc Pattyn28-Dec-06 15:51
sitebuilderLuc Pattyn28-Dec-06 15:51 
AnswerRe: I have some questions in C# Pin
Not Active28-Dec-06 17:21
mentorNot Active28-Dec-06 17:21 
AnswerRe: I have some questions in C# Pin
Flysocket28-Dec-06 20:09
Flysocket28-Dec-06 20:09 
QuestionHow to create and fill DBF with code page 866? Pin
Salogus28-Dec-06 14:14
Salogus28-Dec-06 14:14 
AnswerRe: How to create and fill DBF with code page 866? Pin
ednrgc29-Dec-06 7:57
ednrgc29-Dec-06 7:57 
QuestionRe: How to create and fill DBF with code page 866? Pin
Salogus29-Dec-06 13:25
Salogus29-Dec-06 13:25 
QuestionProgram can't run: "The application has failed to start because its side-by-side configuration is incorrect" Pin
Super Lloyd28-Dec-06 13:27
Super Lloyd28-Dec-06 13:27 
QuestionMulti-frame Tiff files Pin
whatever10128-Dec-06 12:47
whatever10128-Dec-06 12:47 
I am using the following code snippet to generate a multi frame/page Tiff file from a collection of images of varying sizes and dpi values for a new image viewing web/app control I am writing for the new company web site...


System.Drawing.Imaging.Encoder enc =
System.Drawing.Imaging.Encoder.SaveFlag;
EncoderParameters eParms = new EncoderParameters(1);
eParms.Param[0] = new EncoderParameter(
enc,
(long)EncoderValue.MultiFrame
);

Bitmap image = (Bitmap)this[0].Image.Clone();
image.Save(
PathToImage.AbsolutePath,
GetEncoderInfo("image/tiff"),
eParms
);

for (int index = 1; index < this.Count; index++)
{
eParms.Param[0] = new EncoderParameter(
enc,
(long)EncoderValue.FrameDimensionPage
);
try
{
image.SaveAdd(
(Bitmap)this[index].Image.Clone(),
eParms
);
}
catch (Exception ex)
{
errorMessage.Error(ex);
debug.Info(ex);
}
}
eParms.Param[0] = new EncoderParameter(
enc,
(long)EncoderValue.Flush
);
image.SaveAdd(eParms);




This code basically is a method in an imaging array class. It is designed to iterate through the list of images in the array/collection and add each, in turn, to the end of a Tiff image, forming a multi frame Tiff. The resulting image "seems" valid, since it can correctly be read in the Windows Image and Fax viewer, and I can page to each image in using the next/previous buttons... so I know they are there.

However, when I go to read it back in, the number of images reported by

int Frames = img.GetFrameCount(FrameDimension.Page);

is always 1, no matter how many images I put into it,
so the call to

SelectActiveFrameCount(FrameDimension dim, int FrameNo);

always selects the first frame, regardless of what FrameNo is set to. This code is a varyation of code I have found several times from several sites, including Microsoft's.

I am using .NET 2.0 / Visual Studio 2005 / C#.

Am I leaving something out? Can multi frame Tiffs handle a variety of image sizes in the same Tiff file? What could be wrong? My suspicion is that the call to "SaveAdd()" should be generating a new frame entry for the list of frames along with the image itself, but it only adds the image without adding the related frame information. Is there some extra (unmentioned) code that I should add to get it to create the extra frame entry?
QuestionDeployment with .mdb Pin
amatbrewer28-Dec-06 12:38
amatbrewer28-Dec-06 12:38 
AnswerRe: Deployment with .mdb Pin
PIEBALDconsult28-Dec-06 12:53
mvePIEBALDconsult28-Dec-06 12:53 
GeneralRe: Deployment with .mdb Pin
amatbrewer19-Jan-07 8:50
amatbrewer19-Jan-07 8:50 
AnswerRe: Deployment with .mdb Pin
Seishin#29-Dec-06 4:51
Seishin#29-Dec-06 4:51 
GeneralRe: Deployment with .mdb Pin
PIEBALDconsult29-Dec-06 5:28
mvePIEBALDconsult29-Dec-06 5:28 
QuestionTurning off the insertion point. Pin
Jamestown4828-Dec-06 12:11
Jamestown4828-Dec-06 12:11 
AnswerRe: Turning off the insertion point. Pin
Judah Gabriel Himango28-Dec-06 12:26
sponsorJudah Gabriel Himango28-Dec-06 12:26 
AnswerRe: Turning off the insertion point. Pin
PIEBALDconsult28-Dec-06 12:56
mvePIEBALDconsult28-Dec-06 12:56 
GeneralRe: Turning off the insertion point. Pin
Jamestown4828-Dec-06 15:09
Jamestown4828-Dec-06 15:09 
GeneralRe: Turning off the insertion point. Pin
Luc Pattyn28-Dec-06 15:32
sitebuilderLuc Pattyn28-Dec-06 15:32 
GeneralRe: Turning off the insertion point. Pin
Jamestown4828-Dec-06 16:22
Jamestown4828-Dec-06 16:22 
GeneralRe: Turning off the insertion point. Pin
PIEBALDconsult29-Dec-06 4:22
mvePIEBALDconsult29-Dec-06 4:22 
GeneralRe: Turning off the insertion point. Pin
dbetting29-Dec-06 13:59
dbetting29-Dec-06 13:59 
GeneralRe: Turning off the insertion point. Pin
jk chan28-Dec-06 16:52
jk chan28-Dec-06 16:52 
GeneralRe: Turning off the insertion point. Pin
Jamestown4828-Dec-06 16:59
Jamestown4828-Dec-06 16:59 
GeneralRe: Turning off the insertion point. Pin
jk chan28-Dec-06 17:19
jk chan28-Dec-06 17:19 
GeneralRe: Turning off the insertion point. Pin
jk chan28-Dec-06 17:33
jk chan28-Dec-06 17:33 

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.