We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

imageList.TransparentColor

I want to set imageList.TransparentColor to default windows color! How? I have: imageList.TransparentColor=Color. and list of all available colors but not the deafult windows.

11 Replies

AD Administrator Syncfusion Team January 28, 2005 07:08 AM UTC

Try imageList1.TransparentColor = SystemColors.


HV Hrvoje Voda January 28, 2005 08:09 AM UTC

It''s not working. Something is missing.


AD Administrator Syncfusion Team January 28, 2005 09:01 AM UTC

Are you saying that SystemColors.XXXXX does not list the windows colors? Or that your imageList.TransparentColor is not working as you expect? There may be other things you need to do like calling calling bitmap1.MakeTransparent to get things to work. Is this imagelist being used in a grid somehow. Depending on what you are doing, you may have to set some properties like this.gridDataBoundGrid1.SupportsTransparentBackColor = true; to get things to work. Can you send a little sample project showing what you are trying to do with your imagelist and the grid to support@syncfusion.com and mention this forum thread in the subject line? Them maybe we can spot teh problem you are having.


HV Hrvoje Voda January 28, 2005 09:09 AM UTC

I have icon with white background in imageList collection. My grid has a windows default color settings for cell. I would like that my icon has the same background as grid. So, when i change windows settings color that icon background change into that color.


AD Administrator Syncfusion Team January 28, 2005 10:14 AM UTC

I think you have to set bitmap1.MakeTransparent(Color.White); on the bitmap if you want the bitmaps transparent color to be white.


HV Hrvoje Voda January 31, 2005 06:22 AM UTC

I made it transparent but it still has background!


AD Administrator Syncfusion Team January 31, 2005 07:10 AM UTC

Please post a sample project showing the problem.


HV Hrvoje Voda January 31, 2005 07:29 AM UTC

I''m calling AddColumnHeaderAttachment() function in another class. ---------------------------------------- public CtlGridDataTable() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(grid_PrepareViewStyleInfo); } public Syncfusion.Windows.Forms.Grid.GridBoundColumn AddColumnHeaderAttachment( ) { Syncfusion.Windows.Forms.Grid.GridBoundColumn gcol = new Syncfusion.Windows.Forms.Grid.GridBoundColumn(); imageIndex=0; gcol.HeaderText ="Attachment"; grid.SupportsTransparentBackColor =true; grid.GridBoundColumns.Add( gcol ); return gcol; } public void grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { if(e.RowIndex == 0 && e.ColIndex == m_nIdxAttach ) { e.Style.Text = ""; e.Style.CellType = "Static"; e.Style.CellAppearance =GridCellAppearance.Raised; e.Style.BackgroundImageMode= GridBackgroundImageMode.CenterImage; e.Style.BackgroundImage = imageList.Images[ 0 ]; imageList.TransparentColor =System.Drawing.Color.Silver ; } }


AD Administrator Syncfusion Team January 31, 2005 07:48 AM UTC

Here is a sample. It has a red and blue bitmap in a column header. If you run the sample as is, you will see both the red and blue in the header. In the Form.Load, uncomment the MakeTransparent line and you will see only the red in the headder when you run the program. http://www.syncfusion.com/forums/Uploads/ColHeaderImage-0131.zip Tell me how to see the problem you are having in this sample.


HV Hrvoje Voda January 31, 2005 08:11 AM UTC

I''m using gif image that is in imageList collection! So, all methods with icon is in imageList properties that doesn''t have method makeTransparent image.


AD Administrator Syncfusion Team January 31, 2005 08:31 AM UTC

Try converting your icon to a bitmap (icon.ToBitmap()) and use the bitmap in the grid setting its tranparent color once it is a bitmap. Again, if you will post a sample project that I can run and see the problem, I will try to give you a solution.

Loader.
Live Chat Icon For mobile
Up arrow icon