Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hello everyone,
I have a list of type points and each point have x and y. I want to display those points on the screen in the form of a continous line but I can't find the right way to do so.
so my question is : How to display an image on the screen using a set of points ?
Posted
Updated 29-May-12 3:27am
v2
Comments
OriginalGriff 29-May-12 8:35am    
It depends on how you want to display them.
If you want to draw a continuous line between all the points, then that is one thing. If you want to draw a cross at each point that is another. If you want to treat them as the vertices of a solid object (the four corners of a square for example) and fill it, then that is another.
Use the "Improve question" widget to edit your question and provide better information.
Makbg 29-May-12 9:28am    
yes I want to display them as a continous line , should I use draw rectangle for each one or is there a better way ?
Sergey Alexandrovich Kryukov 29-May-12 12:41pm    
No, that's not all. Do you need to spline then; what's are the requirements for interpolation. Do you want to let a line going exactly throw each point, or you need best fit?
--SA

Look at the Graphics.DrawLines method: MSDN[^] - it draws a line following a set of points.
 
Share this answer
 
Please try the followings:

Solution-1:

1) Create an empty Bitmap.
2) But, created Bitmap size must be within the extreme values of the X, Y points (within the maximum values of the X, Y).
3) It is better to create the Bitmap with Format1bppIndexed (or bitonal image).
4) Set your "list of points" to the corresponding pixels in the bitmap. Then, display the bitmap.

Solution-2

Go to Google and search with the 3 keyword of "free imaging SDK". You can find some free imaging SDKs (Home|free imaging sdk something like that...). This sdk has "Array to Image" conversion functions. You can use this as well.

Solution-3

You can use Bitmap class's SetPixel() method as well.

Regards.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900