本文介绍了在Picturebox上绘图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好.
我正在编程一个工具,该工具给出了一个部分(例如16 x 16),用于绘制图像中的字符,但是我做不到,因为我在Internet上找到的所有内容都可以绘制表格.谁能帮我吗?
这是我做的代码,但是不起作用.
在此先感谢:)
Hello everyone.
I''m programming a tool that given a section (eg 16 x 16), drawings of characters from an image, but I can not, because everything that I found on the Internet, draw the form. Can anyone help me?
This is the code that I did, but that does not work.
Thanks in advance:)
private void btnWrite_Click(object sender, EventArgs e)
{
Image img = new Bitmap(ofd.OpenFile());
Rectangle section = new Rectangle();
section.Height = (int)gridHeigth.Value;
section.Width = (int)gridWidth.Value;
section.X = 0;
section.Y = 0;
Graphics grp = CreateGraphics();
grp.DrawImage(img, section);
}
推荐答案
这篇关于在Picturebox上绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!