472,353 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Toolbar Images with "Dirty Edges"

I've been trying to get a standard toolbar to play nice with some nice icons
that I have. When I put them on a button or anything they look perfect, but
through an imagelist and on a toolbar they all have this blue aura around
them. I assume that is from the transparency, but I don't understand why
almost any other control displays them properly.. There really is no
replacement for the toolbar (without paying!), so I hope someone can tell me
how to get these icons to behave! I have them in ICO and PNG format, both
product the same "dirty edge" effect when placed on a toolbar button...

If anyone has any suggestions for a low cost commercial toolbar control, I'm
not opposed to buying something to make this look nice..

Thanks!

--
- Mitchell

Nov 21 '05 #1
7 2840
Hi Mitchell,

Have you tried to set the ImageList's ColorDepth to 32bit and imagesize to
a large one(e.g. 32,32) which may make the icon more "nice"?
Also since the icon is usually 32x32 or even 16x16 pixels, which have
little pixels to present the image, so if we add a large picture into the
imagelist as a icon which may cause the icon distortion.

If you still have any concern, please feel free to post there.
Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #2
The imagelist does not play nice with Alpha. Icons are generally OK, but it
depends on the icons format.

Load the images into the imagelist at runtime and you will get better
results, but the alpha will still be slightly bluish.
You'll also notice that the images in the imagelist only play nicely with
some controls, set a labels image to one of the imagelist alpha images and
you will really see ugly results.

As a workaround you can create icons from the png images at runtime and then
add them to the imagelist(labels still wont like them).
\\\
Dim ico As Icon
Dim bmp As New Bitmap("someimage.png")
ico = Icon.FromHandle(bmp.GetHicon)
ImageList1.Images.Add(ico)
bmp.Dispose()
ico.Dispose()
///
It would probably be better to add the pngs as Embedded Resource rather than
have them distrubuted seperately.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
""Peter Huang" [MSFT]" <v-******@online.microsoft.com> wrote in message
news:qr**************@cpmsftngxa10.phx.gbl...
Hi Mitchell,

Have you tried to set the ImageList's ColorDepth to 32bit and imagesize to
a large one(e.g. 32,32) which may make the icon more "nice"?
Also since the icon is usually 32x32 or even 16x16 pixels, which have
little pixels to present the image, so if we add a large picture into the
imagelist as a icon which may cause the icon distortion.

If you still have any concern, please feel free to post there.
Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 21 '05 #3
I guess the imagelist is just too dysfunctional where alpha is concerned for
my use. I have the images in both ICO (all dimensions) and PNG format and
none of them look even half way decent using an imagelist to attach them to
a toolbar..

I just wanted to make sure that it wasn't just me!

Thanks guys!

--
- Mitchell Vincent

"Mick Doherty"
<EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:eJ**************@TK2MSFTNGP15.phx.gbl...
The imagelist does not play nice with Alpha. Icons are generally OK, but
it depends on the icons format.

Load the images into the imagelist at runtime and you will get better
results, but the alpha will still be slightly bluish.
You'll also notice that the images in the imagelist only play nicely with
some controls, set a labels image to one of the imagelist alpha images and
you will really see ugly results.

As a workaround you can create icons from the png images at runtime and
then add them to the imagelist(labels still wont like them).
\\\
Dim ico As Icon
Dim bmp As New Bitmap("someimage.png")
ico = Icon.FromHandle(bmp.GetHicon)
ImageList1.Images.Add(ico)
bmp.Dispose()
ico.Dispose()
///
It would probably be better to add the pngs as Embedded Resource rather
than have them distrubuted seperately.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
""Peter Huang" [MSFT]" <v-******@online.microsoft.com> wrote in message
news:qr**************@cpmsftngxa10.phx.gbl...
Hi Mitchell,

Have you tried to set the ImageList's ColorDepth to 32bit and imagesize
to
a large one(e.g. 32,32) which may make the icon more "nice"?
Also since the icon is usually 32x32 or even 16x16 pixels, which have
little pixels to present the image, so if we add a large picture into the
imagelist as a icon which may cause the icon distortion.

If you still have any concern, please feel free to post there.
Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no
rights.


Nov 21 '05 #4
If you use the code I suggested to load the png images, as icons, into the
imagelist at runtime then they will look just fine in a toolbar.
You could easily update the code to use the images added as Embedded
Resource, and make a Method of it.

i.e.
\\\
Private Sub Form_Load(ByVal sender As Object, e As EventArgs) _
Handles MyBase.Load
ImageListAddResourcePng(ImageList1,"Image1.png")
ImageListAddResourcePng(ImageList1,"Image2.png")
End Sub

Private Sub ImageListAddResourcePng(ByVal imgList as ImageList , _
ByVal ResourceName As String)
Dim bmp As Bitmap = New Bitmap(Me.GetType, ResourceName)
Dim ico As Icon = Icon.FromHandle(bmp.GetHicon)
imgList.Images.Add(ico)
bmp.Dispose()
ico.Dispose()
End Sub
///

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Mitchell Vincent" <mi*************@community.nospam> wrote in message
news:eR******************@TK2MSFTNGP15.phx.gbl...
I guess the imagelist is just too dysfunctional where alpha is concerned
for my use. I have the images in both ICO (all dimensions) and PNG format
and none of them look even half way decent using an imagelist to attach
them to a toolbar..

I just wanted to make sure that it wasn't just me!

Thanks guys!

--
- Mitchell Vincent

Nov 21 '05 #5
If you use the code I suggested to load the png images, as icons, into the
imagelist at runtime then they will look just fine in a toolbar.
You could easily update the code to use the images added as Embedded
Resource, and make a Method of it.

i.e.
\\\
Private Sub Form_Load(ByVal sender As Object, e As EventArgs) _
Handles MyBase.Load
ImageListAddResourcePng(ImageList1,"Image1.png")
ImageListAddResourcePng(ImageList1,"Image2.png")
End Sub

Private Sub ImageListAddResourcePng(ByVal imgList as ImageList , _
ByVal ResourceName As String)
Dim bmp As Bitmap = New Bitmap(Me.GetType, ResourceName)
Dim ico As Icon = Icon.FromHandle(bmp.GetHicon)
imgList.Images.Add(ico)
bmp.Dispose()
ico.Dispose()
End Sub
///

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Mitchell Vincent" <mi*************@community.nospam> wrote in message
news:eR******************@TK2MSFTNGP15.phx.gbl...
I guess the imagelist is just too dysfunctional where alpha is concerned
for my use. I have the images in both ICO (all dimensions) and PNG format
and none of them look even half way decent using an imagelist to attach
them to a toolbar..

I just wanted to make sure that it wasn't just me!

Thanks guys!

--
- Mitchell Vincent

Nov 21 '05 #6
Hi Mitchell,

Have you tried Mick's suggestion?
If you still have any concern, please feel free to post here.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #7
Hi Mitchell,

Have you tried Mick's suggestion?
If you still have any concern, please feel free to post here.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Aryeh M. Friedman | last post by:
Why is the value of "Instance" whacked in the following code. Note this only happens in Graph::*Wrapper. Also please note that if I hardcode...
2
by: nutthatch | last post by:
I want to be able to import an Excel spreadsheet into Access 2K using the macro command Transferspreadsheet. However, the file I am importing...
5
by: Dave | last post by:
How do I check in a Windows Forms app if any controls have changed? I have a form that collects data, and I want to prompt the user if they try to...
5
by: Alain Filiatrault | last post by:
Hi, I need to implement a "form.dirty" feature on a VB .NET form not related to a database. I need to know if any of the items (Textboxes,...
15
by: aussie rules | last post by:
Hi, I have some really, really large forms with dozens of text boxs. What I want to do is somehow know that the user has edited a text box, so...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.