如何使用图片? 在程序中要用到一些图片,具体该怎么做呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 什么程序,web还是form,用来干什么,这个问题实在是不懂 form中,像把一些图片放到datagridview中的行标头,根据内容的不同来显示不同的图标,比如内容是“warning”的就显示感叹号 imagelist中加入你的图片,然后在你要使用图片的控件中将属性设置到当前的imagelist,选择一个index就可以了 //程序上下文...Graphics grfx = CreateGraphics();Image image = image.FromFile("路径");grfx.DrawImage(image,0,0);//程序上下文 可是,我看到人家这样用的 /// <summary> /// 返回此类使用的缓存 ResourceManager 实例。 /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TestDataGridViewRowStyle.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// 为使用此强类型资源类的所有资源查找 /// 重写当前线程的 CurrentUICulture 属性。 /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static System.Drawing.Bitmap arrow { get { object obj = ResourceManager.GetObject("arrow", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap down { get { object obj = ResourceManager.GetObject("down", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap GradeA { get { object obj = ResourceManager.GetObject("GradeA", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap GradeB { get { object obj = ResourceManager.GetObject("GradeB", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap GradeC { get { object obj = ResourceManager.GetObject("GradeC", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap GradeD { get { object obj = ResourceManager.GetObject("GradeD", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap GradeF { get { object obj = ResourceManager.GetObject("GradeF", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap high { get { object obj = ResourceManager.GetObject("high", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap low { get { object obj = ResourceManager.GetObject("low", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap up { get { object obj = ResourceManager.GetObject("up", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } }这里面的internal static System.Drawing.Bitmap arrow 之类的东西是自己手动添加的吗?还是自动生成的? System.Drawing.Bitmap是GDI+封装的类用到需要自己添加 不是自动生成的 为什么我把上面的代码添加进去后,提示“类型“remoting.Properties.Resources”已经包含“ResourceManager”的定义”? “类型“remoting.Properties.Resources”已经包含“Culture”的定义”? Rectangle _Col= dataGridView1.GetCellDisplayRectangle(0, 0, true);e.Graphics.DrawIcon(this.Icon, new Rectangle(0, _Col.Y, _Col.X, _Col.Height)); 或第一列用Image控件,设置图片或private void DataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e){ if (DataGridView1.Columns[e.ColumnIndex].Name.Equals("Image")) { string path = e.Value.ToString(); e.Value = GetImage(path); }} public System.Drawing.Image GetImage(string path){ return System.Drawing.Image.FromFile(path);} WPF里Popup怎么大到一定限度就显示不完整了呢? C#委托、自定义事件 有关pictruebox根据鼠标移动实时绘图的问题求教 关于在TreeView控件中连续查找结点的问题. 关于输出EXcel的问题 在位置-1处没有任何行 C#中要显示一些柱图啊,饼图啊.有这样的控件吗? 有做过C#智能设备编程的吗? LISTVIEW.ColumnClick.排序300分给分绪贴2 急寻答案:关于白丁选择哪个语言版本数据结构的问题!!!!!!!!!!!! 批处理中timeout不能用 高分求简单程序!急!
//程序上下文...Graphics grfx = CreateGraphics();
Image image = image.FromFile("路径");
grfx.DrawImage(image,0,0);//程序上下文
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TestDataGridViewRowStyle.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 为使用此强类型资源类的所有资源查找
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
internal static System.Drawing.Bitmap arrow {
get {
object obj = ResourceManager.GetObject("arrow", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap down {
get {
object obj = ResourceManager.GetObject("down", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap GradeA {
get {
object obj = ResourceManager.GetObject("GradeA", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap GradeB {
get {
object obj = ResourceManager.GetObject("GradeB", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap GradeC {
get {
object obj = ResourceManager.GetObject("GradeC", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap GradeD {
get {
object obj = ResourceManager.GetObject("GradeD", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap GradeF {
get {
object obj = ResourceManager.GetObject("GradeF", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap high {
get {
object obj = ResourceManager.GetObject("high", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap low {
get {
object obj = ResourceManager.GetObject("low", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap up {
get {
object obj = ResourceManager.GetObject("up", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}这里面的internal static System.Drawing.Bitmap arrow 之类的东西是自己手动添加的吗?还是自动生成的?
用到需要自己添加 不是自动生成的
“类型“remoting.Properties.Resources”已经包含“ResourceManager”的定义”?
“类型“remoting.Properties.Resources”已经包含“Culture”的定义”?
e.Graphics.DrawIcon(this.Icon, new Rectangle(0, _Col.Y, _Col.X, _Col.Height));
或
第一列用Image控件,设置图片
或
private void DataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (DataGridView1.Columns[e.ColumnIndex].Name.Equals("Image"))
{
string path = e.Value.ToString();
e.Value = GetImage(path);
}
}
public System.Drawing.Image GetImage(string path)
{
return System.Drawing.Image.FromFile(path);
}