从一组点创建图像(C#) [英] creating an image from a set of points (C#)

查看:111
本文介绍了从一组点创建图像(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我有一个类型点列表,每个点都有x和y.我想以连续线的形式在屏幕上显示这些点,但找不到正确的方法.
所以我的问题是:如何使用一组点在屏幕上显示图像?

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 ?

推荐答案

看Graphics.DrawLines方法:
Look at the Graphics.DrawLines method: MSDN[^] - it draws a line following a set of points.


请尝试以下操作:

解决方案1:

1)创建一个空的位图.
2)但是,创建的位图大小必须在X,Y点的极值之内(在X,Y的最大值之内).
3)最好使用Format1bppIndexed(或双色调图像)创建位图.
4)将点列表"设置为位图中的相应像素.然后,显示位图.

解决方案2

转到Google并使用免费图像SDK"的3个关键字进行搜索.您可以找到一些免费的图像处理SDK(Home |免费图像sdk之类的...).此sdk具有数组到图像"转换功能.您也可以使用它.

解决方案3

您也可以使用Bitmap类的SetPixel()方法.

问候.
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.


这篇关于从一组点创建图像(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆