使用c#在插图框中插入位图中的线条 [英] drawing lines in a bitmap which is inserted in picturebox using c#
问题描述
我已经采用了一个表单,其中包含listbox和带有位图的图片框。
当我点击一个按钮时,
...执行一个名为createbitmapatruntime()的动作;
当时位图是白色的,带有x和y轴......在鼠标移动时我们可以在放置的鼠标指针处找到坐标....
i有另一个按钮......当被触发时...用文件大小填充列表框(假设有20个文件)..
特定文件夹的
。
位图大小为800 * 600.
所有以MB为单位的文件大小都被转换到字节。
现在/...i想在x轴上为每次迭代绘制不同的文件大小。
假设origibnal文件大小为500 ...并且休息文件大小小于500 ...
x axiz将是10个部分...每个部分代表80分。
1ST文件coordiante(80,500)
第二档cordinate(160,480) )...
第3个文件坐标(240,460)....依此类推......我应该如何标记点...然后画一条线或者使用这些点的曲线。
I have taken a form which consits of listbox and a picturebox witha bitmap.
when i click a button...an action is performed which is called createbitmapatruntime();
at that time the bitmap is white in colour with x and y axis...and on mouse move we can c the coordinates....at the placed mouse pointer.
i have another button...which when triggered...fills the listbox with filesizes(suppose 20 files)..
of a particular folder.
size of bit map is 800*600.
all the filessizes which are in MB is converted to bytes.
now /...i want to plot different file sizes for each iteration on x axis.
suppose origibnal file size is 500...and rest file sizes are less than 500...
x axiz will be 10 parts...each part representing 80 points.
1ST file coordiante(80,500)
2nd file cordinate(160,480)...
3rd file coordinate(240,460)....and so on...how should i mark points...and then draw a line or curve using these points.
推荐答案
你想绘制一个图形。
你可以自己写一个绘图库,最简单的方法是GDI +(查看图形 [ ^ ]类。但是,我建议不要使用这条路线并搜索CodeProject文章,用C#绘制库。
You want to draw a graph.
You could write a plotting library yourself, the easiest way is probably GDI+ (look into the Graphics[^] class. However I would advice against this route and search CodeProject articles for plotting libraries in C#.
这篇关于使用c#在插图框中插入位图中的线条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!