Click here to Skip to main content
15,889,315 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to Programmatically Change a Property in DesignMode Pin
Martin#1-Aug-07 20:56
Martin#1-Aug-07 20:56 
NewsRe: How to Programmatically Change a Property in DesignMode Pin
Cnight Stalker2-Aug-07 15:08
Cnight Stalker2-Aug-07 15:08 
GeneralRe: How to Programmatically Change a Property in DesignMode Pin
Martin#2-Aug-07 20:43
Martin#2-Aug-07 20:43 
QuestionUpdating/changing Items in a ListBox with a TextBox Pin
stephan.smolek31-Jul-07 9:49
stephan.smolek31-Jul-07 9:49 
AnswerRe: Updating/changing Items in a ListBox with a TextBox Pin
bit_cmdr31-Jul-07 11:00
bit_cmdr31-Jul-07 11:00 
GeneralRe: Updating/changing Items in a ListBox with a TextBox Pin
stephan.smolek31-Jul-07 20:44
stephan.smolek31-Jul-07 20:44 
QuestionAverage image brightness Pin
newb2vb31-Jul-07 9:41
newb2vb31-Jul-07 9:41 
AnswerRe: Average image brightness Pin
Christian Graus31-Jul-07 11:39
protectorChristian Graus31-Jul-07 11:39 
newb2vb wrote:
JPEG


The JPEG is irrelevant, it's decompressed to a bitmap in memory.

newb2vb wrote:
I then want to read the overall brightness of this sample image to determine if it is dark, bright, etc...


You may want to convert your pixels to HLS, in order to work out brightness. Then you can check luminance.

newb2vb wrote:
. I will pause so you can finish laughing at me, it was a stupid mistake.


Not at all, it was a viable way to test your code and see what the result was. I'd have used Console.WriteLine and checked the result coming out in the IDE, but either way, it's just test code.

newb2vb wrote:
I understand from what I have read that GetPixel is very slow and that some unsafe code may be quicker but I am still new to image processing in C# so I don't fully understand that.


Yes, you should lock the bits and iterate over them.

My image processing articles will show you how to iterate over the bits of an image, and I have one on converting between RGB and HLS as well. To calculate overall brightness, I'd add the lumanance of each pixel and work out the average across the bitmap.


Christian Graus - Microsoft MVP - C++

"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

GeneralRe: Average image brightness Pin
newb2vb31-Jul-07 12:15
newb2vb31-Jul-07 12:15 
GeneralRe: Average image brightness Pin
Christian Graus31-Jul-07 17:32
protectorChristian Graus31-Jul-07 17:32 
GeneralRe: Average image brightness Pin
newb2vb31-Jul-07 14:19
newb2vb31-Jul-07 14:19 
GeneralRe: Average image brightness Pin
Christian Graus31-Jul-07 17:33
protectorChristian Graus31-Jul-07 17:33 
AnswerRe: Average image brightness Pin
Luc Pattyn31-Jul-07 13:53
sitebuilderLuc Pattyn31-Jul-07 13:53 
QuestionC# Multithreading, GUI hangs while loading Pin
Justincc31-Jul-07 7:11
professionalJustincc31-Jul-07 7:11 
AnswerRe: C# Multithreading, GUI hangs while loading Pin
Luc Pattyn31-Jul-07 7:22
sitebuilderLuc Pattyn31-Jul-07 7:22 
GeneralRe: C# Multithreading, GUI hangs while loading Pin
Justincc31-Jul-07 7:29
professionalJustincc31-Jul-07 7:29 
GeneralRe: C# Multithreading, GUI hangs while loading Pin
PhilDanger31-Jul-07 7:38
PhilDanger31-Jul-07 7:38 
GeneralRe: C# Multithreading, GUI hangs while loading Pin
Justincc31-Jul-07 10:05
professionalJustincc31-Jul-07 10:05 
GeneralRe: C# Multithreading, GUI hangs while loading Pin
PhilDanger31-Jul-07 10:21
PhilDanger31-Jul-07 10:21 
GeneralRe: C# Multithreading, GUI hangs while loading Pin
Justincc31-Jul-07 10:40
professionalJustincc31-Jul-07 10:40 
GeneralRe: C# Multithreading, GUI hangs while loading Pin
Justincc31-Jul-07 10:57
professionalJustincc31-Jul-07 10:57 
GeneralRe: C# Multithreading, GUI hangs while loading Pin
Judah Gabriel Himango31-Jul-07 13:15
sponsorJudah Gabriel Himango31-Jul-07 13:15 
GeneralRe: C# Multithreading, GUI hangs while loading Pin
Luc Pattyn31-Jul-07 7:53
sitebuilderLuc Pattyn31-Jul-07 7:53 
AnswerRe: C# Multithreading, GUI hangs while loading Pin
PhilDanger31-Jul-07 7:30
PhilDanger31-Jul-07 7:30 
GeneralRe: C# Multithreading, GUI hangs while loading Pin
Justincc31-Jul-07 7:36
professionalJustincc31-Jul-07 7:36 

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.