我怎样才能摆脱 Picturebox'边界?
我有 PictureBox
并将其 BorderStyle
设置为 None
但我仍然在它周围有边框。我怎样才能摆脱它?
还有哪些细节?我的图像本身没有边框。 我使用代码
private void btnLoad_Click(object sender, EventArgs e)
{
if (dgOpenFile.ShowDialog() == DialogResult.OK)
{
try
{
img = new Bitmap(dgOpenFile.FileName);
picture.Size = img.Size;
picture.Image = img;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
打开并显示图像:
图像为10x10。它们低于(800%)
原始:
http://img695.imageshack.us/ img695/2409/originallu.png
及其显示方式:
I have PictureBox
and I set its BorderStyle
to None
but I'm still getting a border around it. How can I get rid of that?
What more details? My Image doesn't have borders itself.
I use the code
private void btnLoad_Click(object sender, EventArgs e)
{
if (dgOpenFile.ShowDialog() == DialogResult.OK)
{
try
{
img = new Bitmap(dgOpenFile.FileName);
picture.Size = img.Size;
picture.Image = img;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
To open and display the image:
Image is 10x10. They are below (at 800%)
original:
http://img695.imageshack.us/img695/2409/originallu.png
and how it is displayed:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
应该做的是:
我不明白为什么当我从表单设计器将其设置为
None
时它不起作用。有人知道吗?What should be done is:
I don't understand why it doesn't work when I set it to
None
from Form Designer. Anyone knows?检查
PictureBox
的Padding
属性,将其设置为
0
Check
Padding
property of yourPictureBox
Set it
0