在图片框上显示图像... [英] showing the image on picturebox...

查看:87
本文介绍了在图片框上显示图像...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿成员,
我在Picturebox控件中遇到一些概念上的问题...该如何在PictureBox上显示图像,其中图片或图像文件在磁盘上.... ???
请给我一些小的代码模块,以便我可以了解一个模块....

hey members,
i have some conceptual problem in picturebox control...that how can i show image on picturebox,in which a picture or image file is on disk....???
plz suggest me some small code module so that i could get knowledge about the one....

推荐答案

您可以使用2种方法将图片添加到图片框中. br/> 1.在制作项目时.图片将插入到二进制文件中.

您可以通过选择图片框的属性并提供ImageLocation属性的路径来添加图像位置.

2.您可以在运行时动态添加图片.在这种情况下,图片不是二进制文件,而是存在于硬盘中的某个位置.

您可以在运行时更新ImageLocation属性,如下所示.
You can add picture into the picture box using 2 methods.
1. When you are making the project. Picture will get inserted into the binary.

You can add image location by selecting properties of picturebox and providing path to ImageLocation property.

2. You can add picture dynamically, that is during run time. In this case picture is not inside binary, it is present at some location in the hard disk.

You can update ImageLocation property during runtime as shown below.
public Form1()
{
    InitializeComponent();
    pictureBox2.ImageLocation = @"E:\TP\Songs\AlbumArtSmall.jpg";
}


这篇关于在图片框上显示图像...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆