问题一
Graphics g = e.Graphics;
Image texture1=Image.FromFile("G:\\c#project\\graph\\bin\\Debug\\Bottom_Middle.bmp");
TextureBrush brush = new TextureBrush(texture1);
g.FillRectangle( brush, 100, 100, texture1.Width, texture1.Height);
为什么显示的图片“左边缺 右边多“呢(把多出来的“贴”到左边图片就 全了) 这是为什么呢
我觉得他是先把图片先“贴“满整个窗体 然后把(100, 100, texture1.Width, texture1.Height)这个矩形区域显示出来 而我希望是在
(100, 100, texture1.Width, texture1.Height)划出这个图片
问题二
我在窗体上放了一个button1 当按了button1后 希望在Form1.text="xxx" 但为什么Form1没有text这个属性呢
我是刚学的 大家别笑我
Graphics g = e.Graphics;
Image texture1=Image.FromFile("G:\\c#project\\graph\\bin\\Debug\\Bottom_Middle.bmp");
TextureBrush brush = new TextureBrush(texture1);
g.FillRectangle( brush, 100, 100, texture1.Width, texture1.Height);
为什么显示的图片“左边缺 右边多“呢(把多出来的“贴”到左边图片就 全了) 这是为什么呢
我觉得他是先把图片先“贴“满整个窗体 然后把(100, 100, texture1.Width, texture1.Height)这个矩形区域显示出来 而我希望是在
(100, 100, texture1.Width, texture1.Height)划出这个图片
问题二
我在窗体上放了一个button1 当按了button1后 希望在Form1.text="xxx" 但为什么Form1没有text这个属性呢
我是刚学的 大家别笑我
解决方案 »
- 各位,我想在c#.net的aspx.cs中添加一个函数,请高手指教。
- C#激活为当前的窗口
- 求c#异步tcpip通讯完整代码,socket,急
- 怎么样完成这个sql注入
- !!谁知道像是QQ第六感之类的局域网探测工具的原理?
- SQL Server2003SQL Server2003SQL Server2003SQL Server2003
- 感谢天外来客的帮助请进来领分.
- 请问哪位大侠有C#开发手机或者pda的电子资料
- 求能够在windows98下正常使用的,[VS2003下的水晶报表9.2.3.787版本部署包]
- 请问各位,到底Visual Studio 7.0正式版本出来了没有?我看到了盗版的,但我不知是不是正式版本??
- c# 页面中想点击一个按钮然后弹出一个对话框来选择文件进行添加附件的操作,怎么做?
- Java玩完了,C#也可以跨平台了
this.Text = "xxx";
其实我的理解和大伙是一样的(既g.FillRectangle( brush, 100, 100, texture1.Width, texture1.Height);在窗体坐标的100,100处确定一个矩形 大小是texture1.Width, texture1.Height 然后在这个矩形中进行填充)但是机器上就是显示不对 是否是因为我这个BMP比较小的原因或者是因为图片单位的问题呢(缇?pixel?)
在button1_click 事件中 写Form1.Text 和 this.Text 其实是一样的吧 为什么Form1点后面没有Text这个属性呢
这样说明白了么?
Image TextImage = Image.FromFile("d:\\1.jpg");
//Brush TextBrush = new TextureBrush(TextImage);
Rectangle destRect = new Rectangle(100,100,TextImage.Width,TextImage.Height );
g.DrawImage(TextImage,destRect);
我想把小图片放在窗体的右边 改成这样写 但是图片右边就是少一点 到底怎么能把这个小图片完整的 显示出来
Graphics g = e.Graphics;
Image TextImage = Image.FromFile("d:\\1.jpg");
//Brush TextBrush = new TextureBrush(TextImage);
Rectangle destRect = new Rectangle(this.Width-TextBrush.Width,0,TextImage.Width,TextImage.Height );
g.DrawImage(TextImage,destRect);另外 当我把窗体最大化的时候 好像原来的图片还“残留”着 能否告诉怎么修改(我记得设置一下属性就可以了)