C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2722
Number of posts: 5749

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Dots in C# and Slow Graphics - HELP Posted by horatiu665 on 1 Apr 2012 at 2:04 AM
Hi there. I'm new here.

I have a form application in Visual C# where I draw lots of dots. I mean about the whole screen, full of individual dots with area of 1 pixel. I am using FillRectangle() for this purpose, as DrawLine() is more than 10 times slower, plus it can only draw 2 pixels minimum. My problem is that it takes a while to draw them.

First I thought it's the calculation for what color the dots will have (it's just black and white btw), but then I made it so the calculation's results are saved in a matrix of screen size, with values of 0 and 1, and then the matrix is "drawn" onto the screen. This doesn't make the problem go away.

If you want details about the actual code, I can post them/it, just ask so.

I realized that the problem is with the actual rendering of graphics. I read on a lot of different sites, and searched different queries, but never found anything remotely related to my problem. Usually people draw images or animations, not individual pixels, and that may make my problem so unique.

I have had other problems with this, solved them, but I have reached 3 conclusions:
1. C# sucks at drawing dots
2. There may well be no way to draw graphics faster in C#
3. My Computer Science teacher sucks monkey b@llz

I have nowhere else to search, so I will start as of today writing in forums (for now only this one) and hopefully, someone will help me figure this out, and potentially help others with the same type of problem.

How do you hardware-accelerate the graphics rendering in C#? Would that be a solution? I hope to receive answers from friendly, competent programmers.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.