使用Visual Studio 2005,有没有办法将图像列表中的图像导出到PC上的单个文件?使用IDE,我选择图像列表并查看其属性.在"Images"属性中,我启动了Images Collection Editor对话框.我只能添加和删除图像,但我找不到导出列表中已有图像的方法.
为什么?制作原始列表的开发人员离开了我们公司,我需要ASP.NET应用程序的图像(将转换为.jpeg).
感谢您的帮助!
我有一些图像,我手动添加到imageList Cotrol.现在我需要从imageList中删除thart图像,具体取决于键索引并设置为面板背景.
我该怎么办
当我尝试在树视图中使用图像列表时,单击treenode时图像索引会发生变化.我不知道为什么会这样.谁能帮我?
提前致谢
我有一个旧的VB6应用程序,它使用COMCTL32.OCX("Microsoft Windows公共控件5.0(SP2)")中的ImageList控件来为TreeViews和ListViews提供图标.
该应用程序甚至不会在Windows 7.0 64位上启动.它试图加载具有ImageList的表单的那一刻,就崩溃了(实际上,应用程序眨了眨眼,没有跟踪就退出了).
从表单中删除ImageList可以解决问题.
有任何想法吗?
我花了几个小时来完成这个(简单的)并且找不到解决方案:/
我正在使用D7和TImageList.ImageList被分配给工具栏.当我在设计时填充ImageList时,图标(具有部分透明度)看起来很好.但我需要在运行时填充它,当我这样做时,图标看起来很糟糕 - 完全松散了部分透明度.
我只是尝试从.res文件中加载图标 - 结果相同.我尝试过第三方图像列表也没有成功.我不知道我能做什么:/谢谢2所有;)
编辑:
说实话,我不知道到底发生了什么.Alpha混合是相关术语......这里有两个屏幕:
在设计时添加的图标: 替代文字http://shs-it.de/tmp/icon-designtime.JPG
在运行时添加的图标: 替代文字http://shs-it.de/tmp/icon-runtime.JPG
您不支持Alpha混合的评论带来了解决方案:我在编辑器中编辑了图像并删除了"alpha混合"像素 - 现在它看起来很好.但是,在运行时添加图标而不是设计时,图标看起来仍然很奇怪.如果你(或其他人)可以解释它,我会很高兴;)感谢您的支持!
我使用ImageList了TreeView和ListView.我首先将图像质量设置为32位,然后添加半透明图像.质量看起来不错,但在编写,编译和执行应用程序几分钟后,质量看起来很糟糕.
看截图:

使用过的属性
ColorDepth: Depth32Bit
ImageSize: 16; 16
TransparentColor: Transparent
Run Code Online (Sandbox Code Playgroud)
像素背后有黑色像素,半透明但不完全透明.
重新添加所有图像会恢复原始质量,但几分钟后,它就会显示在屏幕截图的右侧.
我正在尝试在运行时创建并绘制一个32位位图,然后将其添加到ImageList.位图具有透明度(alpha通道).我可以创建位图并在它的Canvas上绘制没有任何问题,并且它在任何其他画布上都具有透明度.
问题是当我将它添加到ImageList时,图像似乎丢失了使用位图的Canvas属性制作的图形.
以下是我启动Bitmap的方法:
Bitmap := TBitmap.Create;
Bitmap.PixelFormat := pf32bit;
Bitmap.Transparent := True;
Bitmap.AlphaFormat := afDefined;
SetBkMode(Bitmap.Canvas.Handle, TRANSPARENT);
Bitmap.SetSize(100, 42);
// now I can draw, let's say, an icon from an imagelist
ImageList.Draw(Bitmap.Canvas, 5, 5, 0, dsTransparent, itImage);
// and some other stuff
Bitmap.Canvas.RoundRect(0, 0, 99, 41, 5, 5);
Bitmap.Canvas.TextOut(50, 5, 'Test string');
Run Code Online (Sandbox Code Playgroud)
如果我将此Bitmap绘制到任何控件画布,它会使用图像列表中的图像,圆角矩形和文本,使用透明背景(任何未绘制的任何内容都是透明的;将保留已存在的背景)进行正常绘制.这意味着Form1.Canvas.Draw(0, 0, Bitmap);将在Form1上绘制位图,如果那里有任何其他图像,它将保留为背景.
但是,如果我将此位图添加到图像列表,则会出现奇怪的问题.ImageList将ColorDepth设置为cd32bit,然后调用:
BitmapImageList.Width := Bitmap.Width;
BitmapImageList.Hieght := Bitmap.Height;
BitmapImageList.Add(Bitmap, nil);
Run Code Online (Sandbox Code Playgroud)
现在,如果我尝试从图像列表中绘制该图像:
BitmapImageList.Draw(Form1.Canvas, 0, 0, 0);
Run Code Online (Sandbox Code Playgroud)
将显示的唯一内容是从ImageList在Bitmap中绘制的图像,圆角矩形和在Canvas中绘制的文本消失.
我错过了什么?
无法使用precacheImage函数将本地图像从资产加载并缓存到 flutter 中的 GridView 或 ListView。
问题:滚动列表时,图像总是重新加载。
class AppLandingPage extends StatelessWidget {
final String title;
AppLandingPage({Key key, this.title}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: DrawerPage(),
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return getToolbarWidget("Home title");
},
body: setDataToContainer(),
));
}
}
Container setDataToContainer() {
return Container(
color: Colors.white,
margin: EdgeInsets.only(left: 4.0, right: 4, bottom: 4, top: 4),
child: CustomScrollView(
slivers: <Widget>[
SliverList(
delegate: SliverChildListDelegate(
[
HeaderWidget("Header 1"),
],
),
),
SliverGrid(
gridDelegate: …Run Code Online (Sandbox Code Playgroud) 处理ImageList对象的适当方法是什么?
假设我有一个private ImageList imageList成员的类。现在,有时我会执行以下代码:
// Basically, lazy initialization.
if (imageList == null)
{
imageList = new ImageList();
Image[] images = Provider.CreateImages(...);
foreach (var image in images)
{
// Does the 'ImageList' perform implicit copying here
// or does it aggregate a reference?
imageList.Images.Add(image);
// Do I need to do this?
//image.Dispose();
}
}
return imageList;
Run Code Online (Sandbox Code Playgroud)
在同一个类中,我有Dispose方法实现,其执行方式如下:
public void Dispose()
{
if (!disposed)
{
// Is this enough?
if (imageList != null)
imageList.Dispose();
disposed = …Run Code Online (Sandbox Code Playgroud) 我想ImageList使用计时器循环显示图像。它工作正常,除了PictureBox当PictureBox它应该显示图像列表中的图片时,在a上生动显示的相同图像会失去其质量。
直接显示时的图像PictureBox:

显示在PictureBox但通过ImageList( pictureBox1.Image = imglist.Images[0];) 时的图像:

我的图片是一个128x128png,这里是我PictureBox和我的设计器代码ImageList:
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(378, 78);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(128, 128);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false;
//
// imglist
//
this.imglist.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imglist.ImageStream")));
this.imglist.TransparentColor = System.Drawing.Color.Transparent;
this.imglist.Images.SetKeyName(0, "1423093311_supportfemale-48.png");
Run Code Online (Sandbox Code Playgroud)
