Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2008, 08:54 PM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default Plotting points for math program

I'm building an application for a graduate math class. I need to calculate values at each point on a graph and assign a color to that pixel. My problem is that I can't find a way to control the color of a single pixel. There doesn't seem to be a method of the graphics object I'm using that supports that. I've also tried configuring the methods that are there DrawLine, DrawRectangle, DrawEllipse and adjusting settings for the degenerate case of a point. However, the smallest I can get is a 1 pixel by 2 pixel line segment (2 pixels), if I push it smaller, it doesn't output anything at all (0 pixels). How can I control and paint just 1 pixel for my project?

-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old May 13th, 2008, 03:08 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Bitmap.SetPixel is probably your best bet. For this you will likely need to draw to a bitmap and then copy the bitmap to the final destination.

/- Sam Judson : Wrox Technical Editor -/
 
Old May 13th, 2008, 09:05 PM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

That's doable, in fact it's probably better practice isn't it? Then I can load the bitmap in the onPaint event.

So I'll be manipulating a bitmap directly instead of manipulating a graphics object (like I do when using DrawLine, etc.)? I'll probably be back with bitmap implementation questions later then.

Thanks!

-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.





Similar Threads
Thread Thread Starter Forum Replies Last Post
MSChart - modifying points using DataPoints.Item() Nick.Net VB.NET 2002/2003 Basics 1 August 27th, 2007 09:49 PM
How to Plotting on a map by GPS? goreng C# 0 December 18th, 2006 09:13 AM
GPS, Plotting on a map goldablasha C# 0 October 20th, 2005 07:34 PM
FSO Map.Path points to development site nancy Classic ASP Basics 0 April 27th, 2005 01:23 PM
Plotting co-ordinates nishantpandit VS.NET 2002/2003 4 April 20th, 2004 02:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.