Click here to Skip to main content
15,919,931 members
Home / Discussions / C#
   

C#

 
GeneralListView & Scroll Bars (Events) Pin
Andy Hampshire30-Jan-03 8:07
Andy Hampshire30-Jan-03 8:07 
GeneralRe: ListView & Scroll Bars (Events) Pin
Stephane Rodriguez.30-Jan-03 8:49
Stephane Rodriguez.30-Jan-03 8:49 
GeneralDataGrid Column Display Pin
hkl30-Jan-03 7:40
hkl30-Jan-03 7:40 
GeneralRe: DataGrid Column Display Pin
A.Wegierski30-Jan-03 19:19
A.Wegierski30-Jan-03 19:19 
QuestionHow to decide whether control is initialized within IDE form designer? Pin
Vasek30-Jan-03 7:37
Vasek30-Jan-03 7:37 
AnswerRe: How to decide whether control is initialized within IDE form designer? Pin
leppie30-Jan-03 10:08
leppie30-Jan-03 10:08 
GeneralRe: How to decide whether control is initialized within IDE form designer? Pin
Vasek30-Jan-03 22:25
Vasek30-Jan-03 22:25 
Questionhow to convert a jpeg into tiff Pin
coralie30-Jan-03 4:15
coralie30-Jan-03 4:15 
This is the code I have been writing. For any conversion from bmp to any other image format it works,from jpeg to gif , bmp or png files it works. But when I try a conversion from jpeg to tiff , this is the exception I kept receiveing and I can't see what it refers to:

Invalid parameter used.
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)

Does anyone has a clue or met a similar problem.ThanksConfused | :confused:


/*----------Beginning of the code-----------------*/
Bitmap bBitmapTemp = new Bitmap(bBitmapIm);<br />
//convert first from jpeg to a bmp<br />
imViewerSetCompression ("image/bmp", sfname, bBitmapTemp);<br />
<br />
//This the line causing the exception<br />
//convert to tiff<br />
imViewerSetCompression ("image/tiff", svdasFileName, bBitmapTemp);<br />
<br />
private void imViewerSetCompression (String sMimetype ,String sfilename, Bitmap myBitmap)<br />
{		<br />
        ImageCodecInfo      myImageCodecInfo;<br />
        Encoder             myEncoder;<br />
        EncoderParameter    myEncoderParameter;<br />
	EncoderParameters   myEncoderParameters;<br />
		<br />
        // Get an ImageCodecInfo object that represents the imagetype codec.<br />
        myImageCodecInfo = GetEncoderInfo (sMimetype);<br />
	// Create an Encoder object based on the GUID for the Compression   parameter category.<br />
	myEncoder = Encoder.Compression;<br />
	// Create an EncoderParameters object.An EncoderParameters object has an array of EncoderParameter<br />
	// objects. In this case, there is only one EncoderParameter object in the array.<br />
	myEncoderParameters = new EncoderParameters (1);<br />
	// Save the bitmap as a another file with LZW compression.<br />
	myEncoderParameter = new EncoderParameter (myEncoder,(long)EncoderValue.CompressionLZW);<br />
	myEncoderParameters.Param[0] = myEncoderParameter;<br />
        myBitmap.Save (sfilename, myImageCodecInfo, myEncoderParameters);        <br />
	}

AnswerRe: how to convert a jpeg into tiff Pin
Stephane Rodriguez.30-Jan-03 8:27
Stephane Rodriguez.30-Jan-03 8:27 
QuestionHow to find the location of a control relative to it's containing form? Pin
Furty30-Jan-03 2:53
Furty30-Jan-03 2:53 
AnswerRe: How to find the location of a control relative to it's containing form? Pin
Philip Fitzsimons30-Jan-03 3:04
Philip Fitzsimons30-Jan-03 3:04 
GeneralRe: How to find the location of a control relative to it's containing form? Pin
Furty30-Jan-03 3:21
Furty30-Jan-03 3:21 
GeneralRe: How to find the location of a control relative to it's containing form? Pin
Philip Fitzsimons30-Jan-03 3:28
Philip Fitzsimons30-Jan-03 3:28 
GeneralRe: How to find the location of a control relative to it's containing form? Pin
Furty31-Jan-03 17:08
Furty31-Jan-03 17:08 
GeneralVS.Net Add-in help needed Pin
PSainsbury30-Jan-03 1:55
PSainsbury30-Jan-03 1:55 
QuestionHow to generate a graphic in the c# asp .net? Pin
zoltix29-Jan-03 22:33
zoltix29-Jan-03 22:33 
AnswerRe: How to generate a graphic in the c# asp .net? Pin
leppie30-Jan-03 6:08
leppie30-Jan-03 6:08 
GeneralRe: How to generate a graphic in the c# asp .net? Pin
zoltix30-Jan-03 6:20
zoltix30-Jan-03 6:20 
GeneralRe: How to generate a graphic in the c# asp .net? Pin
leppie30-Jan-03 9:37
leppie30-Jan-03 9:37 
GeneralRe: How to generate a graphic in the c# asp .net? Pin
zoltix30-Jan-03 12:50
zoltix30-Jan-03 12:50 
AnswerRe: How to generate a graphic in the c# asp .net? Pin
Nick Parker30-Jan-03 16:06
protectorNick Parker30-Jan-03 16:06 
Generalspell check system Pin
jtmtv1829-Jan-03 21:31
jtmtv1829-Jan-03 21:31 
GeneralPassing string to C dll from c# Pin
suresh_sathya29-Jan-03 19:53
suresh_sathya29-Jan-03 19:53 
GeneralRe: Passing string to C dll from c# Pin
Stephane Rodriguez.30-Jan-03 10:27
Stephane Rodriguez.30-Jan-03 10:27 
GeneralC#, IWebBrowser2, and JScript Pin
Patrick Hill29-Jan-03 14:32
Patrick Hill29-Jan-03 14:32 

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.