Click here to Skip to main content
15,920,708 members
Home / Discussions / C#
   

C#

 
QuestionArabic Breaker Pin
ellllllllie2-Jun-09 19:03
ellllllllie2-Jun-09 19:03 
AnswerRe: Arabic Breaker Pin
Christian Graus2-Jun-09 20:23
protectorChristian Graus2-Jun-09 20:23 
GeneralRe: Arabic Breaker Pin
ellllllllie2-Jun-09 21:30
ellllllllie2-Jun-09 21:30 
GeneralRe: Arabic Breaker Pin
Christian Graus2-Jun-09 21:36
protectorChristian Graus2-Jun-09 21:36 
GeneralRe: Arabic Breaker Pin
J4amieC2-Jun-09 22:22
J4amieC2-Jun-09 22:22 
GeneralRe: Arabic Breaker Pin
Vasudevan Deepak Kumar2-Jun-09 21:58
Vasudevan Deepak Kumar2-Jun-09 21:58 
QuestionHow can I make IE window blank for a specific url? Pin
svt gdwl2-Jun-09 18:44
svt gdwl2-Jun-09 18:44 
AnswerRe: How can I make IE window blank for a specific url? Pin
Christian Graus2-Jun-09 20:23
protectorChristian Graus2-Jun-09 20:23 
QuestionToolbar developmet for internet explorer Pin
pithyvishal2-Jun-09 17:51
pithyvishal2-Jun-09 17:51 
QuestionHow to generate odbcDataAdapter.TableMappings? Pin
Morven Huang2-Jun-09 17:18
Morven Huang2-Jun-09 17:18 
QuestionHow to design a web spider Pin
Fired.Fish.Gmail2-Jun-09 16:45
Fired.Fish.Gmail2-Jun-09 16:45 
AnswerRe: How to design a web spider Pin
Mycroft Holmes2-Jun-09 16:57
professionalMycroft Holmes2-Jun-09 16:57 
GeneralRe: How to design a web spider Pin
Fired.Fish.Gmail15-Jun-09 19:16
Fired.Fish.Gmail15-Jun-09 19:16 
QuestionHow to receiving an incoming SMS message? in C# Pin
Md. Ali Naser Khan2-Jun-09 16:07
Md. Ali Naser Khan2-Jun-09 16:07 
AnswerRe: How to receiving an incoming SMS message? in C# Pin
Christian Graus2-Jun-09 16:11
protectorChristian Graus2-Jun-09 16:11 
GeneralRe: How to receiving an incoming SMS message? in C# Pin
Md. Ali Naser Khan2-Jun-09 16:58
Md. Ali Naser Khan2-Jun-09 16:58 
GeneralRe: How to receiving an incoming SMS message? in C# Pin
Christian Graus2-Jun-09 18:20
protectorChristian Graus2-Jun-09 18:20 
AnswerRe: How to receiving an incoming SMS message? in C# Pin
Giorgi Dalakishvili2-Jun-09 19:53
mentorGiorgi Dalakishvili2-Jun-09 19:53 
QuestionFastest way to scan an image for pixel color (black and white) Pin
sebogawa2-Jun-09 15:41
sebogawa2-Jun-09 15:41 
AnswerRe: Fastest way to scan an image for pixel color (black and white) Pin
Luc Pattyn2-Jun-09 15:54
sitebuilderLuc Pattyn2-Jun-09 15:54 
Hi,

here are some ideas:

1. j <= detectLeft.Height gets executed for every pixel, you'd better store detectLeft.Height in a local int variable

2. executing a lot of GetPixel() calls tends to be slow since each time the coordinates are checked against the image boundaries, and translated into a linear index, something that can be done more easily once one knows they all get handled sequentially

3. the most practical approach to (2) is by using pointers

4. why do you use 4 bytes per pixel if all it can be is black and white; an array (bools, bytes, ints, ...) or a BitArray would be more economical in space, and hence in speed (assuming your image is say 512*512, it takes 1MB which is about the size of the level 2 cache); less data would run faster.
Maybe you should swith to one byte per pixel (optimum between density and simplicity)

5. there are special code snippets to find the lowest bit set in an integer, this could be much faster assuming a binary image (yours is), and a majority of zeroes.
x & -x results in zero if x is zero, and in an int with exactly one bit set which is also set in x otherwise.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Fastest way to scan an image for pixel color (black and white) Pin
sebogawa2-Jun-09 16:12
sebogawa2-Jun-09 16:12 
GeneralRe: Fastest way to scan an image for pixel color (black and white) Pin
Alan Balkany3-Jun-09 5:03
Alan Balkany3-Jun-09 5:03 
QuestionBottom-Up Datagrid Pin
eziksoft2-Jun-09 15:17
eziksoft2-Jun-09 15:17 
AnswerRe: Bottom-Up Datagrid Pin
Mycroft Holmes2-Jun-09 17:03
professionalMycroft Holmes2-Jun-09 17:03 
GeneralRe: Bottom-Up Datagrid Pin
eziksoft3-Jun-09 5:28
eziksoft3-Jun-09 5:28 

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.