Click here to Skip to main content
16,005,120 members
Home / Discussions / C#
   

C#

 
AnswerRe: How do I run class constructor without calling it's method's C# ? Pin
Guffa29-Oct-07 22:10
Guffa29-Oct-07 22:10 
GeneralRe: How do I run class constructor without calling it's method's C# ? Pin
Dima.HEMEHT30-Oct-07 1:13
Dima.HEMEHT30-Oct-07 1:13 
AnswerRe: How do I run class constructor without calling it's method's C# ? Pin
Guffa30-Oct-07 4:20
Guffa30-Oct-07 4:20 
GeneralRe: How do I run class constructor without calling it's method's C# ? Pin
Dima.HEMEHT31-Oct-07 5:21
Dima.HEMEHT31-Oct-07 5:21 
QuestionDateTime Pin
mihksoft29-Oct-07 12:50
mihksoft29-Oct-07 12:50 
AnswerRe: DateTime Pin
Colin Angus Mackay29-Oct-07 12:55
Colin Angus Mackay29-Oct-07 12:55 
GeneralRe: DateTime Pin
mihksoft29-Oct-07 13:52
mihksoft29-Oct-07 13:52 
QuestionConvert from Image (bitmap -> jpeg) to byte[] and back [modified] Pin
szolDat29-Oct-07 12:44
szolDat29-Oct-07 12:44 
I always get an argumentexception on the following code, and I don't know why.


                bmp = new Bitmap(typeof(Form1), "toProcess.bmp"); //Read an image from hdd


                MemoryStream mstream = new MemoryStream();


                bmp.Save(mstream, ImageFormat.Jpeg); //Save image into MemoryStream in jpeg


                jpegByteArray = new byte[mstream.Length];


                mstream.Read(jpegByteArray, 0, (int)mstream.Length); //Read mstream into byte[]


                MemoryStream jpegStream = new MemoryStream();


                jpegstream.Write(jpegByteArray, 0, jpegByteArray.Length); //Write byte[] back to another MemoryStream


                jpegstream.Position = 0;


                Image newimg = Image.FromStream(jpegstream); //THIS throws an ArgumentException




I checked in debugging mode and every variable has the exact same number of bytes, and if I only save the image into a stream and read it right back, then it works. Please save me from pulling my hair out and shoot me with any help you can think of!


-- modified at 18:50 Monday 29th October, 2007
AnswerRe: Convert from Image (bitmap -> jpeg) to byte[] and back Pin
Muhammad Shahid Farooq29-Oct-07 14:50
professionalMuhammad Shahid Farooq29-Oct-07 14:50 
AnswerRe: Convert from Image (bitmap -> jpeg) to byte[] and back [modified] Pin
szolDat29-Oct-07 23:22
szolDat29-Oct-07 23:22 
Questiondebugging C# dll Pin
pnpfriend29-Oct-07 12:06
pnpfriend29-Oct-07 12:06 
AnswerRe: debugging C# dll Pin
Malcolm Smart29-Oct-07 22:23
Malcolm Smart29-Oct-07 22:23 
GeneralRe: debugging C# dll Pin
pnpfriend30-Oct-07 6:13
pnpfriend30-Oct-07 6:13 
QuestionLighten a color Pin
Mike Hankey29-Oct-07 12:03
mveMike Hankey29-Oct-07 12:03 
AnswerRe: Lighten a color Pin
Anthony Mushrow29-Oct-07 12:16
professionalAnthony Mushrow29-Oct-07 12:16 
GeneralRe: Lighten a color Pin
Mike Hankey29-Oct-07 13:30
mveMike Hankey29-Oct-07 13:30 
QuestionCustomized date formating Pin
Glen Harvy29-Oct-07 11:33
Glen Harvy29-Oct-07 11:33 
AnswerRe: Customized date formating Pin
Colin Angus Mackay29-Oct-07 12:53
Colin Angus Mackay29-Oct-07 12:53 
GeneralRe: Customized date formating Pin
Glen Harvy29-Oct-07 15:32
Glen Harvy29-Oct-07 15:32 
GeneralRe: Customized date formating Pin
Colin Angus Mackay29-Oct-07 22:37
Colin Angus Mackay29-Oct-07 22:37 
GeneralRe: Customized date formating Pin
Glen Harvy30-Oct-07 1:31
Glen Harvy30-Oct-07 1:31 
GeneralRe: Customized date formating Pin
Glen Harvy29-Oct-07 16:56
Glen Harvy29-Oct-07 16:56 
GeneralRe: Customized date formating Pin
Colin Angus Mackay29-Oct-07 22:43
Colin Angus Mackay29-Oct-07 22:43 
GeneralRe: Customized date formating Pin
Glen Harvy30-Oct-07 1:33
Glen Harvy30-Oct-07 1:33 
AnswerRe: Customized date formating Pin
PIEBALDconsult29-Oct-07 14:32
mvePIEBALDconsult29-Oct-07 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.