473,837 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2945
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(label s still wont like them).
\\\
Dim ico As Icon
Dim bmp As New Bitmap("someima ge.png")
ico = Icon.FromHandle (bmp.GetHicon)
ImageList1.Imag es.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.m icrosoft.com> wrote in message
news:qr******** ******@cpmsftng xa10.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.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in
message news:eJ******** ******@TK2MSFTN GP15.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(label s still wont like them).
\\\
Dim ico As Icon
Dim bmp As New Bitmap("someima ge.png")
ico = Icon.FromHandle (bmp.GetHicon)
ImageList1.Imag es.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.m icrosoft.com> wrote in message
news:qr******** ******@cpmsftng xa10.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
ImageListAddRes ourcePng(ImageL ist1,"Image1.pn g")
ImageListAddRes ourcePng(ImageL ist1,"Image2.pn g")
End Sub

Private Sub ImageListAddRes ourcePng(ByVal imgList as ImageList , _
ByVal ResourceName As String)
Dim bmp As Bitmap = New Bitmap(Me.GetTy pe, 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.nos pam> wrote in message
news:eR******** **********@TK2M SFTNGP15.phx.gb l...
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
ImageListAddRes ourcePng(ImageL ist1,"Image1.pn g")
ImageListAddRes ourcePng(ImageL ist1,"Image2.pn g")
End Sub

Private Sub ImageListAddRes ourcePng(ByVal imgList as ImageList , _
ByVal ResourceName As String)
Dim bmp As Bitmap = New Bitmap(Me.GetTy pe, 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.nos pam> wrote in message
news:eR******** **********@TK2M SFTNGP15.phx.gb l...
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
1578
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 BredthFirstPrint and make both approriate func ptrs it works fine. void print(void *data); #define R 'r'-'r' #define S 's'-'r'
2
3618
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 that are "dirty" i.e. the field contents do not comply with the expected format (date/time) and they end up in a seperate table of import errors. (The records in "error" are actually empty fields.) This is a regular event and I do not want to...
5
11380
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 changes that have been made. In MFC/Win32, you'd trap the WM_COMMAND/EN_CHANGE notification messages, etc. But, this doesn't seem to happen in Windows Forms. I tried Spy-ing a windows forms app, and the WM_COMMAND messages don't even get sent...
5
4368
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 and easy way to do this? Thanks in advance. Alain
15
4028
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 they would like to save there changes. Is there a simple way to do this, or do I have to have code in each text boxes keypress(?) event ?
0
9683
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,...
0
10883
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, 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...
0
10578
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10631
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,...
0
9409
agi2029
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...
1
7813
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7006
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5670
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5851
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.