Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to resolve this FxCop warning? Pin
Guffa9-Aug-07 14:01
Guffa9-Aug-07 14:01 
GeneralRe: How to resolve this FxCop warning? Pin
Scott Dorman9-Aug-07 17:16
professionalScott Dorman9-Aug-07 17:16 
AnswerRe: How to resolve this FxCop warning? Pin
Judah Gabriel Himango9-Aug-07 15:31
sponsorJudah Gabriel Himango9-Aug-07 15:31 
GeneralRe: How to resolve this FxCop warning? Pin
Scott Dorman9-Aug-07 17:20
professionalScott Dorman9-Aug-07 17:20 
Questionchanging color of a edited row of a datagrid Pin
Nosnibor9-Aug-07 11:12
Nosnibor9-Aug-07 11:12 
AnswerRe: changing color of a edited row of a datagrid Pin
Nouman Bhatti9-Aug-07 20:06
Nouman Bhatti9-Aug-07 20:06 
AnswerRe: changing color of a edited row of a datagrid Pin
Nouman Bhatti9-Aug-07 20:08
Nouman Bhatti9-Aug-07 20:08 
QuestionDetermine the amount of red in an image Pin
newb2vb9-Aug-07 10:28
newb2vb9-Aug-07 10:28 
Hello!

I have an interesting idea, I would like to read through a 24 bit JPEG image and determine the amount of a color is in the image. In this case I would like to analyze just how much red is in an image based on how many of the pixels are mostly red and return a value based on how many pixels are mostly red.

I need it to be fairly quick (~ 1 second) so I know that locking the bitmap and using unsafe code is the way to go. The problem is that I am having a hard time figuring out how to get the pixel data I want to get using the unsafe code method. I know that with the GetPixel method, it would be something like:

for (int h = 0; h < bmp.Height; h++)
{

for (int w = 0; w < bmp.Width; w++)
{

Color pixelColor = bmp.GetPixel(w, h);



int red = pixelColor.R;

int green = pixelColor.G;

int blue = pixelColor.B;




sumred += red;

How do I do this same procedure using the unsafe/locked bitmap method? Also, how do I do the logic/math to determine from this the amount of red data in the image?

Thank you in advance!!

Mike
AnswerRe: Determine the amount of red in an image Pin
Christian Graus9-Aug-07 11:20
protectorChristian Graus9-Aug-07 11:20 
AnswerRe: Determine the amount of red in an image [modified] Pin
Luc Pattyn9-Aug-07 11:49
sitebuilderLuc Pattyn9-Aug-07 11:49 
AnswerRe: Determine the amount of red in an image Pin
c0ax_lx10-Aug-07 4:29
c0ax_lx10-Aug-07 4:29 
QuestionClipboard copy and a listview Pin
Piet Pelle9-Aug-07 9:31
Piet Pelle9-Aug-07 9:31 
AnswerRe: Clipboard copy and a listview Pin
Judah Gabriel Himango9-Aug-07 9:43
sponsorJudah Gabriel Himango9-Aug-07 9:43 
GeneralRe: Clipboard copy and a listview Pin
Piet Pelle9-Aug-07 9:54
Piet Pelle9-Aug-07 9:54 
GeneralRe: Clipboard copy and a listview Pin
Judah Gabriel Himango9-Aug-07 9:57
sponsorJudah Gabriel Himango9-Aug-07 9:57 
GeneralRe: Clipboard copy and a listview Pin
Piet Pelle9-Aug-07 10:14
Piet Pelle9-Aug-07 10:14 
GeneralRe: Clipboard copy and a listview Pin
Piet Pelle9-Aug-07 10:33
Piet Pelle9-Aug-07 10:33 
GeneralRe: Clipboard copy and a listview Pin
Judah Gabriel Himango9-Aug-07 10:43
sponsorJudah Gabriel Himango9-Aug-07 10:43 
GeneralRe: Clipboard copy and a listview [modified] Pin
Luc Pattyn9-Aug-07 10:53
sitebuilderLuc Pattyn9-Aug-07 10:53 
GeneralRe: Clipboard copy and a listview Pin
Judah Gabriel Himango9-Aug-07 11:52
sponsorJudah Gabriel Himango9-Aug-07 11:52 
GeneralRe: Clipboard copy and a listview Pin
Luc Pattyn9-Aug-07 12:03
sitebuilderLuc Pattyn9-Aug-07 12:03 
GeneralRe: Clipboard copy and a listview Pin
Judah Gabriel Himango9-Aug-07 12:55
sponsorJudah Gabriel Himango9-Aug-07 12:55 
GeneralRe: Clipboard copy and a listview Pin
Luc Pattyn9-Aug-07 13:05
sitebuilderLuc Pattyn9-Aug-07 13:05 
GeneralRe: Clipboard copy and a listview Pin
Piet Pelle9-Aug-07 10:55
Piet Pelle9-Aug-07 10:55 
Questionwhat is a C# reference type Pin
misha_grewal9-Aug-07 7:33
misha_grewal9-Aug-07 7: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.