473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 2915
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 WalkFunc and PrintFunct to be BredthFirst and...
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 (over which I have no control) contains some records...
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 exit the app, or load a new file, without saving...
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, combo, listboxes, ...) was changed. Is there a quick...
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 that if they close the form, i can ask them if...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.