Click here to Skip to main content
15,923,142 members
Home / Discussions / C#
   

C#

 
AnswerRe: Info about sound from microphone Pin
Leslie Sanford27-Jun-07 16:39
Leslie Sanford27-Jun-07 16:39 
QuestionOWC Excel Problem Pin
TheMajorRager27-Jun-07 11:38
TheMajorRager27-Jun-07 11:38 
AnswerRe: OWC Excel Problem Pin
Dave Kreskowiak27-Jun-07 12:01
mveDave Kreskowiak27-Jun-07 12:01 
QuestionCan I change the Opacity of control units in a form? Pin
Khoramdin27-Jun-07 10:35
Khoramdin27-Jun-07 10:35 
AnswerRe: Can I change the Opacity of control units in a form? Pin
Ed.Poore27-Jun-07 10:43
Ed.Poore27-Jun-07 10:43 
AnswerRe: Can I change the Opacity of control units in a form? Pin
Dave Kreskowiak27-Jun-07 11:57
mveDave Kreskowiak27-Jun-07 11:57 
QuestionImage Processing: Redraw the outline of any image (sketching) in C#.Net, but How?? Pin
zeeShan anSari27-Jun-07 9:44
zeeShan anSari27-Jun-07 9:44 
AnswerRe: Image Processing: Redraw the outline of any image (sketching) in C#.Net, but How?? Pin
Luc Pattyn27-Jun-07 10:16
sitebuilderLuc Pattyn27-Jun-07 10:16 
Hi,

this is completely wrong in many ways:

1.
your code includes a lot of magical numbers (a width of 300, a height of 200) ?
Good code does not do that. Such numbers are either constants (declare constants then),
or they are variables that get their value somewhere (e.g. int width=bitmap.Width;).

2.
you are nesting five for loops; the inner loop would execute some
300*200*100*100*100 times, thats 60 billion times. How long do you expect this will take ?
Nesting that many loops seldom is the right way to achieve anything.

3.
what is the use of the for loops over r1/r2/r3 ?
you can replace them with:
int r1=p.Color.Red;
int r2=p.Color.Green;
int r3=p.Color.Blue;
and then check whether r1/r2/r3 are in the range [0,100).
Why search for something that you already know ???

4.
Graphics.DrawRectangle with a size of 1*1 is an expensive way to set one pixel.
Cant you use bitmap.SetPixel ?

5.
Why create a new pen for every pixel, you can use the same pen over and over.

6.
I dont think turning some pixels transparant is the right way to achieve
whatever it is you are trying to achieve.

Conclusion:
I strongly suggest you search CodeProjects for some articles on Graphics,
they are plenty and there are some pretty good ones. Then study those and learn
about realistic ways of doing things, before you start creating some weird code
of your own... Have a look at image filtering, edge enhancement, and many more.
And once you think you know what you need, try creating some quality code, and
organize it such that you can test it on much smaller images.

Smile | :)




AnswerRe: Image Processing: Redraw the outline of any image (sketching) in C#.Net, but How?? Pin
Christian Graus27-Jun-07 10:47
protectorChristian Graus27-Jun-07 10:47 
GeneralRe: Image Processing: Redraw the outline of any image (sketching) in C#.Net, but How?? Pin
Luc Pattyn27-Jun-07 11:04
sitebuilderLuc Pattyn27-Jun-07 11:04 
GeneralRe: Image Processing: Redraw the outline of any image (sketching) in C#.Net, but How?? Pin
Christian Graus27-Jun-07 11:53
protectorChristian Graus27-Jun-07 11:53 
QuestionStruct in designer Pin
Stevo Z27-Jun-07 9:10
Stevo Z27-Jun-07 9:10 
AnswerRe: Struct in designer Pin
J. Dunlap27-Jun-07 10:09
J. Dunlap27-Jun-07 10:09 
GeneralRe: Struct in designer Pin
Stevo Z27-Jun-07 10:14
Stevo Z27-Jun-07 10:14 
GeneralRe: Struct in designer Pin
Stevo Z27-Jun-07 11:36
Stevo Z27-Jun-07 11:36 
QuestionOWC Excel Components Pin
TheMajorRager27-Jun-07 8:51
TheMajorRager27-Jun-07 8:51 
AnswerRe: OWC Excel Components Pin
Dave Kreskowiak27-Jun-07 9:08
mveDave Kreskowiak27-Jun-07 9:08 
GeneralRe: OWC Excel Components [modified] Pin
TheMajorRager27-Jun-07 10:23
TheMajorRager27-Jun-07 10:23 
GeneralRe: OWC Excel Components Pin
Dave Kreskowiak27-Jun-07 11:56
mveDave Kreskowiak27-Jun-07 11:56 
QuestionC# - Resizing multi-dimensional arrays Pin
mdwhite7627-Jun-07 7:37
mdwhite7627-Jun-07 7:37 
AnswerRe: C# - Resizing multi-dimensional arrays Pin
Dave Kreskowiak27-Jun-07 7:53
mveDave Kreskowiak27-Jun-07 7:53 
AnswerRe: C# - Resizing multi-dimensional arrays Pin
Martin#27-Jun-07 8:08
Martin#27-Jun-07 8:08 
GeneralRe: C# - Resizing multi-dimensional arrays Pin
mdwhite7628-Jun-07 5:04
mdwhite7628-Jun-07 5:04 
Questiontwo appilcations accessing the same memory Pin
Yitzchok Dev27-Jun-07 7:35
Yitzchok Dev27-Jun-07 7:35 
AnswerRe: two appilcations accessing the same memory Pin
Luc Pattyn27-Jun-07 8:57
sitebuilderLuc Pattyn27-Jun-07 8:57 

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.