为什么不用下面的方法来绘啊?在指定位置并且按指定大小绘制指定的 Image 对象。
[C#]
public void DrawImage(
Image image,
Rectangle rect
)
参数
image
要绘制的 Image 对象。
rect
Rectangle 结构,它指定所绘制图像的位置和大小。
返回值
此方法不返回值。备注
由 image 对象表示的图像被缩放为 rect 矩形的尺寸。
[C#]
public void DrawImage(
Image image,
Rectangle rect
)
参数
image
要绘制的 Image 对象。
rect
Rectangle 结构,它指定所绘制图像的位置和大小。
返回值
此方法不返回值。备注
由 image 对象表示的图像被缩放为 rect 矩形的尺寸。
解决方案 »
- 求助如何在前台验证用户名是否存在
- 多线程管理问题
- C#开发网路游戏的问题!
- 我想读取excell文件中的数据
- 在treeview如何判断所选中的节是否根节子
- visual studio 中怎么才能把几个Textbox控件命名为一个数组啊,使其成为textbox(1),textbox(2)......这样
- 小问题???
- 如何去除字符串中的 " 号
- 怎样用C#取得 硬盘上存放的一首mp3文件的播放时间长度?
- 如何在页面中有button的情况下在repeater中实现回车换行效果
- 为什么我在本地机odbc可以连接配置ORACLE连接,而C#中则不行
- 我用的Visual Studio.Net编译器的问题?
这两个参数传给别人呀,是接口的参数,所以一定的算出来
[email protected]
Image image=Image.FromFile(@"C:\Documents and Settings\greystar\My Documents\HOWTO\了解 XML 命名空间.files\text.jpg");
Rectangle rect=new Rectangle(0,0,image.Width,image.Height);
g.DrawImage(image,rect);
g.TranslateTransform(image.Width+10,0); Rectangle smallRect=new Rectangle(0,0,80,80); g.DrawImage(image,smallRect,80,0,106,121,GraphicsUnit.Pixel);
g.TranslateTransform(0,10);
Rectangle r=new Rectangle(0,0,80,80);
g.DrawImage(image,r,56,101,35,40,GraphicsUnit.Pixel);