....or am I missing something?
Setup:
- I've created an empty Winforms project, and added two buttons A and B.
- Button A's Image property is set to point to a imagefile calles
"users.png"
- Added an imagelist and added the SAME image to this list, setting the
properties (size etc.) exactly the same as for A's Image property.
- Set button B's ImageList property to the new imagelist created, and it's
imageindex to 0.
The picture now shows on both buttons, but while Button A's image looks
great, Button B's image looks awful, with a blue border around
it....remember: It is the exact same picture, size, etc....
I did another post earlier, but after trying to tweak every possible setting
myself, and after extensive help from Armin Zingler, we have still not found
a reason for this behaviour. This may possibly be a problem affecting a lot
of users, so if anyone has suggestions on why this occurs, please let me
know... And if this is not a bug, there should be someone out there that
knows how to fix this....I hope... :-)
I've provided a link to my testproject, the original .png image is in the
/bin folder. http://langedal.com/testicons.zip
Getting increasingly frustrated.... ;-)
Roger 16 2272
I tried setting the Imagelist's Colordepth to 24-bits instead of 8bit, and
nothing. So maybe it's a bug... The same happens on the Toolbar.
By the way, that is a great image! How/where did you get them? created them
yourself?
Andre Nogueira
"Roger" <ro******@hotma il.com> wrote in message
news:uF******** ******@TK2MSFTN GP10.phx.gbl... ...or am I missing something?
Setup:
- I've created an empty Winforms project, and added two buttons A and B. - Button A's Image property is set to point to a imagefile calles "users.png" - Added an imagelist and added the SAME image to this list, setting the properties (size etc.) exactly the same as for A's Image property. - Set button B's ImageList property to the new imagelist created, and it's imageindex to 0.
The picture now shows on both buttons, but while Button A's image looks great, Button B's image looks awful, with a blue border around it....remember: It is the exact same picture, size, etc....
I did another post earlier, but after trying to tweak every possible setting myself, and after extensive help from Armin Zingler, we have still not found a reason for this behaviour. This may possibly be a problem affecting a lot of users, so if anyone has suggestions on why this occurs, please let me know... And if this is not a bug, there should be someone out there that knows how to fix this....I hope... :-)
I've provided a link to my testproject, the original .png image is in the /bin folder.
http://langedal.com/testicons.zip
Getting increasingly frustrated.... ;-)
Roger
* "Roger" <ro******@hotma il.com> scripsit: ...or am I missing something?
Setup:
- I've created an empty Winforms project, and added two buttons A and B. - Button A's Image property is set to point to a imagefile calles "users.png" - Added an imagelist and added the SAME image to this list, setting the properties (size etc.) exactly the same as for A's Image property. - Set button B's ImageList property to the new imagelist created, and it's imageindex to 0.
The picture now shows on both buttons, but while Button A's image looks great, Button B's image looks awful, with a blue border around it....remember: It is the exact same picture, size, etc....
That's an issue with the ImageList control. The imagelist will support
bitmaps only when used at design time. Nevertheless, I didn't get it
work with adding the images at runtime (the blue changes to black).
There were some other threads on this issue, maybe you will find
something useful there:
<http://www.google.com/groups?q=dotnet +imagelist+tran sparency+png>
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> schrieb There were some other threads on this issue, maybe you will find something useful there:
<http://www.google.com/groups?q=dotnet +imagelist+tran sparency+png>
If I had been so clever to ask google first, it would have saved me about 5
hours.... ;-((
--
Armin
* "Armin Zingler" <az*******@free net.de> scripsit: There were some other threads on this issue, maybe you will find something useful there:
<http://www.google.com/groups?q=dotnet +imagelist+tran sparency+png>
If I had been so clever to ask google first, it would have saved me about 5 hours.... ;-((
Google is your friend!
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Thanks guys for excellent help :-)
As a workaround I've ended up doctoring the png's into bmp's with a
background color matching my app, to fake transparency... . :-D Annoying
extra-work, but it works..... Hope MS knows about this issue and addresses
it...
Thanks again,
Roger
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bv******** ****@ID-208219.news.uni-berlin.de... * "Roger" <ro******@hotma il.com> scripsit: ...or am I missing something?
Setup:
- I've created an empty Winforms project, and added two buttons A and B. - Button A's Image property is set to point to a imagefile calles "users.png" - Added an imagelist and added the SAME image to this list, setting the properties (size etc.) exactly the same as for A's Image property. - Set button B's ImageList property to the new imagelist created, and
it's imageindex to 0.
The picture now shows on both buttons, but while Button A's image looks great, Button B's image looks awful, with a blue border around it....remember: It is the exact same picture, size, etc....
That's an issue with the ImageList control. The imagelist will support bitmaps only when used at design time. Nevertheless, I didn't get it work with adding the images at runtime (the blue changes to black).
There were some other threads on this issue, maybe you will find something useful there:
<http://www.google.com/groups?q=dotnet +imagelist+tran sparency+png>
-- Herfried K. Wagner [MVP] <http://www.mvps.org/dotnet>
* "Roger" <ro******@hotma il.com> scripsit: As a workaround I've ended up doctoring the png's into bmp's with a background color matching my app, to fake transparency... . :-D Annoying extra-work, but it works..... Hope MS knows about this issue and addresses it...
But this won't allow an alpha chanel, or am I missing something?
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
True :-)
It seemed at first glance to work, but no it is far from what I
wanted....but I haven't found a way to "hack" this from the links you
posted. Maybe I'm giving up way to easily.... :-)
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bv******** ****@ID-208219.news.uni-berlin.de... * "Roger" <ro******@hotma il.com> scripsit: As a workaround I've ended up doctoring the png's into bmp's with a background color matching my app, to fake transparency... . :-D Annoying extra-work, but it works..... Hope MS knows about this issue and
addresses it...
But this won't allow an alpha chanel, or am I missing something?
-- Herfried K. Wagner [MVP] <http://www.mvps.org/dotnet>
* "Roger" <ro******@hotma il.com> scripsit: It seemed at first glance to work, but no it is far from what I wanted....but I haven't found a way to "hack" this from the links you posted. Maybe I'm giving up way to easily.... :-)
I had a look at the links I posted and I see that there is no good
solution to the problem available.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
If I convert my .png to an .ico file, and add it to my project as an
embedded resource it seems to handle the transparency problem moe
gracefully, but still the edges seems jagged and rough...
Using this code:
ImageList1.Imag es.Add(New
Icon(System.Ref lection.Assembl y.GetExecutingA ssembly.GetMani festResourceStr e
am("testIcons.u sers128.ico")). )
ImageList1.Imag eSize = New System.Drawing. Size(128, 128)
Button1.ImageLi st = ImageList1
Button1.ImageIn dex = 0
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:Or******** *****@tk2msftng p13.phx.gbl... * "Roger" <ro******@hotma il.com> scripsit: It seemed at first glance to work, but no it is far from what I wanted....but I haven't found a way to "hack" this from the links you posted. Maybe I'm giving up way to easily.... :-)
I had a look at the links I posted and I see that there is no good solution to the problem available.
-- Herfried K. Wagner [MVP] <http://www.mvps.org/dotnet> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: SpaceMind |
last post by:
Hi, I´m using this code for changing the size property of an ImageList :
ImageList.ImageSize = new Size(32,32);
However , the Icon property just lost´s his data.
Before code:
ImageList.Images.Count == 1
After:
|
by: Bob C. |
last post by:
Hi All,
I am using the ImageList/ListView Components to display around 100 images
in C#.NET.
The issue i have is, some times i may need to display the thumbnail of size
more then 256x256 in ImageList.
But the ImageList Component supports only size upto 256x256.
What is the best way to handle this?
|
by: Sanjeeva Reddy |
last post by:
hai Anti Keskinen,
i have used
the following code MyListView->LargeImageList->ImageSize = gcnew
System::Drawing::Size(100,
100); // Sets large image size to 100, 100
here i am getting error like "gcnew is undeclared error",how to deeclare
'gcnew"
and when i am using in runtime to change the size of images in imagelist in
listview control in .net(forms application) by chnging one trckbar(like
tb1->Value),
|
by: Andrew Christiansen |
last post by:
Hey everyone. I have Visual Basic .NET 2003 and am trying to show images on
a treeview control. I have the imagelist on the form filled with images,
and have the ImageList property of the treeview control set to the imagelist
containing the images I want to be displayed next to each node.
It seems that no matter what I do there will be no images displayed next to
the nodes during runtime. I tried creating nodes during designtime using...
|
by: David |
last post by:
I have a problem that just cropped up with using an ImageList in my project
I am using VB .NET 200
Problem:
I have existing Form with 2 Image List controls. ImageList16 (for 16x16 Images) and ImageList24 (for 24x24). I have inserted images in each and it has worked fine for months... The System.Drawing.Bitmap properties for these images are PixelFormat=32bppArgb and RawFormat=MemoryBmp with the Horiz and VerticalResolution = 96
I...
| |
by: Just Me |
last post by:
If I add an image to an imagelist using
imageList.Images.Add...
And use it with a tree node
tn.ImageIndex = imageList.Images.Count-1
This is the actual code:
Win32.Shell.SHGetFileInfo(NodePath, 256, fileinfo, cbFileInfo, flags)
tvFolders.ImageList.Images.Add(Icon.FromHandle(fileinfo.hIcon))
tn.ImageIndex = tvFolders.ImageList.Images.Count - 1
|
by: henrycortezwu |
last post by:
Hi,
I have a WinXPSP2, P4 3.2GHZ, 1GIG RAM on my dev machine using VS2005
VB.NET. I did the following procedure:
1. Added 82 icons (128x128 in size & 32bit Depth) in an imagelist
control
2. Save the project
3. Complied the project (successful)
4. Closed the project
5. Opened the project
|
by: senfo |
last post by:
I'm using a ListView control to display pictures similarly to how
Windows Explorer displays pictures in "Thumbnails" view. The images are
stored in an ImageList component. I would like to provide the ability
to rotate the images and I'm having some issues.
Basically, what I've tried is:
lstViewImages.LargeImageList.Images.RotateFlip(RotateFlipType.Rotate90FlipNone);
lstViewImages.Update();
|
by: wolffy |
last post by:
okay heres my problem;
i want to add image K to a imagelist, thats easy. The hard part is that the imagelist was made in Application Settings. **I made the imagelist in application settings so i could eventually add in code which would make its value saved when the form closes** But every time i use something like this
image k = toolstrip1.backgroundimage;
Settings.Default.kill.Images.Add(k);
**kill is the name of the imagelist**
i get...
|
by: =?Utf-8?B?S2VuTg==?= |
last post by:
We're using a System.Windows.Forms.ImageList to store a bunch of Images that
I've loaded, and rendering each image in the ImageList during a draw loop.
The process was running unusually slow and was causing memory spikes. After
several hours we discovered that the ImageList.Images indexer is actually
returning a copy of the added Images instead of simply returning a reference.
Needless to say, we were a bit surprised and disturbed to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |