将图像添加到ImageList [英] Adding Images to ImageList

查看:86
本文介绍了将图像添加到ImageList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。



我正在开发一个项目,它将在嵌入式PC上的Windows CE上运行。

所以我必须使用.net框架2.



如何将图像添加到图像列表?

似乎没有系统。 Drawing.Image.FromFile方法。

Hi every one

I'm developing a project which is going to run on Windows CE in an embedded PC.
So I have to use .net framework 2.

How can I add images to an imagelist?
It seems that there is no System.Drawing.Image.FromFile method.

推荐答案

尝试:

Try:
Image im = new Bitmap(path);


string path = Assembly.GetExecutingAssembly().GetName().CodeBase;

char[] address = path.ToCharArray();

string final_address = "";

for (int i = 0; i < address.Length; i++)
{
    final_address += address[i];
}

Image img = new Bitmap(final_address + "1.jpg");

pictureBox1.Image = img;


这篇关于将图像添加到ImageList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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