Click here to Skip to main content
15,909,437 members
Home / Discussions / C#
   

C#

 
AnswerRe: Sending http request to server using C#.net Pin
Ravi Bhavnani26-Oct-07 4:44
professionalRavi Bhavnani26-Oct-07 4:44 
AnswerRe: Sending http request to server using C#.net Pin
MCEdwards26-Oct-07 5:57
MCEdwards26-Oct-07 5:57 
QuestionBitmap to Jpeg conversion Pin
B!Z26-Oct-07 2:00
B!Z26-Oct-07 2:00 
AnswerRe: Bitmap to Jpeg conversion Pin
Vasudevan Deepak Kumar26-Oct-07 2:33
Vasudevan Deepak Kumar26-Oct-07 2:33 
QuestionHow to do matrix multiplication by reading data in two data grid Pin
rj.rajakumar26-Oct-07 1:44
rj.rajakumar26-Oct-07 1:44 
AnswerRe: How to do matrix multiplication by reading data in two data grid Pin
Paul Conrad27-Oct-07 11:17
professionalPaul Conrad27-Oct-07 11:17 
QuestionGrayscale image Pin
yohanes.luhur26-Oct-07 1:38
yohanes.luhur26-Oct-07 1:38 
AnswerRe: Grayscale image Pin
Luc Pattyn26-Oct-07 2:57
sitebuilderLuc Pattyn26-Oct-07 2:57 
Hi,

the Image class gives each pixel a Color value, which is basically a 32-bit number
(4 bytes, for alpha,red,green,blue). To make it a grayscale image, you should make
sure all pixels have no color by giving them the same value for red, green and blue.

So basically you could do (pseudocode!):
foreach (pixel pix in image) {
    int gray=(R+G+B)/3;
    pix.color=new color(gray,gray,gray);
}


For normal sized images this would be rather slow, you could consider using pointers.

Remark: CodeProject holds a good series of articles on image operations by Christian Graus.
You may want to read these.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]


this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google


AnswerRe: Grayscale image Pin
Christian Graus26-Oct-07 11:45
protectorChristian Graus26-Oct-07 11:45 
AnswerRe: foreach [modified] Pin
Anthony Mushrow26-Oct-07 1:39
professionalAnthony Mushrow26-Oct-07 1:39 
GeneralRe: foreach Pin
Justin Perez26-Oct-07 3:11
Justin Perez26-Oct-07 3:11 
GeneralRe: foreach Pin
Paul Conrad27-Oct-07 11:18
professionalPaul Conrad27-Oct-07 11:18 
QuestionTo Resize Word document or Pdf file. Pin
vijaiganesh26-Oct-07 1:02
vijaiganesh26-Oct-07 1:02 
Questionswitch statement Pin
codemunkeh26-Oct-07 1:02
codemunkeh26-Oct-07 1:02 
AnswerRe: switch statement Pin
J4amieC26-Oct-07 1:05
J4amieC26-Oct-07 1:05 
GeneralRe: switch statement Pin
codemunkeh26-Oct-07 1:14
codemunkeh26-Oct-07 1:14 
GeneralRe: switch statement Pin
Urs Enzler26-Oct-07 1:24
Urs Enzler26-Oct-07 1:24 
AnswerRe: switch statement Pin
Scott Dorman26-Oct-07 3:48
professionalScott Dorman26-Oct-07 3:48 
QuestionUsing Javascript to fire an event in another class....? Pin
Dave2560026-Oct-07 0:51
Dave2560026-Oct-07 0:51 
AnswerRe: Using Javascript to fire an event in another class....? Pin
Shanmugam R26-Oct-07 1:45
Shanmugam R26-Oct-07 1:45 
GeneralRe: Using Javascript to fire an event in another class....? [modified] Pin
Dave2560026-Oct-07 2:04
Dave2560026-Oct-07 2:04 
GeneralRe: Using Javascript to fire an event in another class....? Pin
kubben26-Oct-07 3:07
kubben26-Oct-07 3:07 
GeneralRe: Using Javascript to fire an event in another class....? Pin
Dave2560026-Oct-07 3:23
Dave2560026-Oct-07 3:23 
QuestionCOM Object error Pin
DeepOceans26-Oct-07 0:50
DeepOceans26-Oct-07 0:50 
Questiondatagridview update Pin
NewToAspDotNet26-Oct-07 0:43
NewToAspDotNet26-Oct-07 0:43 

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.