imagelist

Disposing an ImageList

柔情痞子 提交于 2019-12-07 11:30:21
问题 What's the appropriate way to dispose an ImageList object? Suppose I have some class with a private ImageList imageList member. Now, at some moment I perform the following code: // 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

Animated GIF in ImageList / TabPage

99封情书 提交于 2019-12-07 07:21:08
问题 I'd like to show an animated GIF as the tab image on a TabPage . If I add my image to an ImageList and use the TabPage.ImageIndex property, it only shows the first frame (and doesn't animate): ImageList imageList = new ImageList(); imageList.Images.Add(Properties.Resources.my_animated_gif); tabControl.ImageList = imageList; tabPage.ImageIndex = 0; A few forums on the net also suggest ImageList doesn't support animated GIFs. Is there an easy way to display an animated GIF as an image on a

ImageList capacity bug in .NET ImageList implementation?

廉价感情. 提交于 2019-12-06 04:27:20
I am having some problems utilizing an ImageList for my ListView in a .net application. In my implementation, this ImageList can hold a few thousand images depending on use. The issue originally arose when I was trying to work with a large number of images. Once I was getting past 5K+ images, I was running into a generic "Image cannot be added to the ImageList" exception trying to add an image. The exact number where this failure occurred jumped around a little bit. So, in trying to solve this issue I've tried to expand the capacity of the ImageList using native ImageList_SetImageCount

Animated GIF in ImageList / TabPage

这一生的挚爱 提交于 2019-12-05 17:39:56
I'd like to show an animated GIF as the tab image on a TabPage . If I add my image to an ImageList and use the TabPage.ImageIndex property, it only shows the first frame (and doesn't animate): ImageList imageList = new ImageList(); imageList.Images.Add(Properties.Resources.my_animated_gif); tabControl.ImageList = imageList; tabPage.ImageIndex = 0; A few forums on the net also suggest ImageList doesn't support animated GIFs. Is there an easy way to display an animated GIF as an image on a TabPage ? Do I have to owner-draw and animate the image? This is a late answer but hopefully someone will

Add Transparent and stretched Image to Imagelist in Delphi

ぐ巨炮叔叔 提交于 2019-12-05 04:11:00
问题 According to my previous question with the help of Cosmin Prund, I found how to stretch Image and add to ImageList: procedure LoadDatasetImagesToImageList; var StretchedBMP: TBitmap; MS: TMemoryStream; begin ImageList.Clear; ItemsDts.First; StretchedBMP := TBitmap.Create; try // Prepare the stretched bmp's size StretchedBMP.Width := ImageList.Width; StretchedBMP.Height := ImageList.Height; // Prepare the memory stream MS := TMemoryStream.Create; try ImageBitmap:= TBitmap.Create; try while not

How to Export Images from an Image List in VS2005?

落花浮王杯 提交于 2019-12-04 01:32:19
Using Visual Studio 2005, is there a way to export the images in an Image List to individual files on my PC? Using the IDE, I select the Image List and view its properties. In the "Images" property, I launch the Images Collection Editor dialog. I can only add and remove images, but I cannot find a way to export an image that is already in the list. Why? The developer who made the original list has left our company and I need the images for an ASP.NET application (will convert to .jpeg). Thank you for the help! Jason Berkan You can write some simple code to export the images. You don't mention

Add Transparent and stretched Image to Imagelist in Delphi

流过昼夜 提交于 2019-12-03 20:55:58
According to my previous question with the help of Cosmin Prund, I found how to stretch Image and add to ImageList: procedure LoadDatasetImagesToImageList; var StretchedBMP: TBitmap; MS: TMemoryStream; begin ImageList.Clear; ItemsDts.First; StretchedBMP := TBitmap.Create; try // Prepare the stretched bmp's size StretchedBMP.Width := ImageList.Width; StretchedBMP.Height := ImageList.Height; // Prepare the memory stream MS := TMemoryStream.Create; try ImageBitmap:= TBitmap.Create; try while not ItemsDts.Eof do begin if not ItemsDtsPicture.IsNull then begin MS.Size := 0; ItemsDtsPicture

Delphi - Populate an imagelist with icons at runtime 'destroys' transparency

夙愿已清 提交于 2019-12-03 14:15:51
I've spended hours for this (simple) one and don't find a solution :/ I'm using D7 and the TImageList. The ImageList is assigned to a toolbar. When I populate the ImageList at designtime, the icons (with partial transparency) are looking fine. But I need to populate it at runtime, and when I do this the icons are looking pretty shitty - complete loose of the partial transparency. I just tried to load the icons from a .res file - with the same result. I've tried third party image lists also without success. I have no clue what I could do :/ Thanks 2 all ;) edit: To be honest I dont know exactly

*.bmp loses transparent background if using v6 ImageList Control

自古美人都是妖i 提交于 2019-12-02 23:49:21
问题 I'm sorry, my english is not very good. I need to use semi-transparent bitmap pictures in my D7 app. So, i should use XPManifest and ImageList version6 instead of 5.8 standard one. But in this case, I faced a problev: all images loses their transparency while I load them form stream! type TForm2 = class(TForm) btn4: TButton; btn5: TButton; lst1: TbtkListView; il1: TImageList; btn1: TButton; tlb1: TToolBar; btn2: TToolButton; btn3: TToolButton; xpmnfst1: TXPManifest; procedure btn4Click(Sender

How to add border to items in a listview control using C#?

ε祈祈猫儿з 提交于 2019-12-02 09:16:23
问题 I am using a listview control where I am adding Images through ImageList if (dtPhoto.Rows.Count > 0) { foreach (DataRow dr in dtPhoto.Rows) { if (dr["Photo"].ToString() != "") { byte[] barrImg = (byte[])dr["Photo"]; MemoryStream mStream = new MemoryStream(barrImg); imageList.Images.Add(Image.FromStream(mStream)); } } } imageList.ImageSize = new Size(75, 75); lvItem.LargeImageList = imageList; for (int i = 0; i < imageList.Images.Count; i++) { lvItem.Items.Add(dtPhoto.Rows[i]["Name"].ToString(