Click here to Skip to main content
15,891,951 members
Home / Discussions / C#
   

C#

 
GeneralRe: Attachng Database Pin
led mike20-Mar-09 8:33
led mike20-Mar-09 8:33 
GeneralRe: Attachng Database Pin
Luc Pattyn20-Mar-09 8:15
sitebuilderLuc Pattyn20-Mar-09 8:15 
AnswerRe: Attachng Database Pin
Mbah Dhaim20-Mar-09 11:20
Mbah Dhaim20-Mar-09 11:20 
QuestionMessage Removed Pin
20-Mar-09 3:42
professionalN_tro_P20-Mar-09 3:42 
AnswerRe: How to convert byte[] to Stream Pin
musefan20-Mar-09 4:15
musefan20-Mar-09 4:15 
GeneralMessage Removed Pin
20-Mar-09 4:47
professionalN_tro_P20-Mar-09 4:47 
GeneralRe: How to convert byte[] to Stream Pin
musefan20-Mar-09 4:51
musefan20-Mar-09 4:51 
AnswerRe: How to convert byte[] to Stream Pin
Luc Pattyn20-Mar-09 4:18
sitebuilderLuc Pattyn20-Mar-09 4:18 
Hi Collin,

Not every stream/file constitutes a valid image; what Image.FromStream() accepts is the streamed content of an image file, as Image.FromFile() would expect. There is more to an image than just a bunch of RGB values; it needs dimensions, pixel depth information, maybe a color lookup table, compression information, etc.

Now what is it you want to achieve? You already have a valid image to start with, so why not modify it rather than copying/modifying its pixels, then work from there.

FYI: setting every third byte to 255 produces red only if (1) you do have a 24bpp image (which would be exceptional, most .NET images are 32bpp) and (2) the image is sufficiently dark (a white pixel will remain white, a yellow one will remain yellow)

BTW: in general when getting an exception, you should look at it; when posting a message, you should report it, that could help getting more and better replies sooner. In this particular case, you were bound to get an ArgumentException telling you not much except the one argument wasn't good enough...

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


GeneralMessage Removed Pin
20-Mar-09 4:46
professionalN_tro_P20-Mar-09 4:46 
GeneralRe: How to convert byte[] to Stream Pin
Luc Pattyn20-Mar-09 5:00
sitebuilderLuc Pattyn20-Mar-09 5:00 
AnswerRe: How to convert byte[] to Stream Pin
Fayu20-Mar-09 4:45
Fayu20-Mar-09 4:45 
GeneralMessage Removed Pin
20-Mar-09 4:49
professionalN_tro_P20-Mar-09 4:49 
GeneralRe: How to convert byte[] to Stream Pin
Fayu20-Mar-09 4:53
Fayu20-Mar-09 4:53 
QuestionRich text to canvas Pin
damichab20-Mar-09 3:29
damichab20-Mar-09 3:29 
AnswerRe: Rich text to canvas Pin
musefan20-Mar-09 3:54
musefan20-Mar-09 3:54 
GeneralRe: Rich text to canvas Pin
damichab20-Mar-09 4:04
damichab20-Mar-09 4:04 
GeneralRe: Rich text to canvas Pin
musefan20-Mar-09 4:08
musefan20-Mar-09 4:08 
GeneralRe: Rich text to canvas Pin
damichab20-Mar-09 4:22
damichab20-Mar-09 4:22 
QuestionLaunch Program and embed it or place it on a child form Pin
Wallbert Elicot20-Mar-09 1:46
Wallbert Elicot20-Mar-09 1:46 
AnswerRe: Launch Program and embed it or place it on a child form Pin
DaveyM6920-Mar-09 2:01
professionalDaveyM6920-Mar-09 2:01 
Questionopen existing excel file as a new document. [modified] Pin
amit_8320-Mar-09 1:45
amit_8320-Mar-09 1:45 
QuestionProperty is IEnumerable Pin
Adriaan Davel20-Mar-09 1:35
Adriaan Davel20-Mar-09 1:35 
AnswerRe: Property is IEnumerable Pin
moon_stick20-Mar-09 2:29
moon_stick20-Mar-09 2:29 
GeneralRe: Property is IEnumerable Pin
Adriaan Davel20-Mar-09 3:50
Adriaan Davel20-Mar-09 3:50 
GeneralRe: Property is IEnumerable Pin
moon_stick20-Mar-09 4:13
moon_stick20-Mar-09 4:13 

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.