May 5th, 2005, 09:59 PM
#1
Bitmap Map - Almost Solved
How do you use a a single bitmap that contains several separate images in a toolbar button? I assume that a
image list is needed but how do you tell it which area to use, etc. ? Do I have to parse out the images as
separate images altogether?
Thanks
Last edited by RobDog888; May 7th, 2005 at 01:36 PM .
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
May 5th, 2005, 11:01 PM
#2
Re: Bitmap Map
Bitmap removed in order to stay within licensing terms.
Last edited by RobDog888; Nov 16th, 2005 at 05:59 PM .
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
May 6th, 2005, 02:32 AM
#3
Re: Bitmap Map
You can use the AddStrip() method of an image list (you have to use one indeed):
VB Code:
ImageList1.Images.AddStrip(New System.Windows.Forms.PictureBox().Image.FromFile("C:\216.gif"))
and then you can assign the image index to one of your buttons.
Weird thing is that you never specify the number of images in the image strip - but AddStrip() figures it out anyway.
May 6th, 2005, 09:07 AM
#4
Re: Bitmap Map
It probably assumes that all the icons are square and not rectangular, thus its Length / height to find out how many icons are present.
I don't live here any more.
May 6th, 2005, 09:34 AM
#5
Re: Bitmap Map
The ImageList has an ImageSize property the Width of which is used to calculate the breaking up of the strip.
May 6th, 2005, 11:07 AM
#6
Re: Bitmap Map
Originally Posted by
ntg
You can use the AddStrip() method of an image list (you have to use one indeed):
VB Code:
ImageList1.Images.AddStrip(New System.Windows.Forms.PictureBox().Image.FromFile("C:\216.gif"))
and then you can assign the image index to one of your buttons.
Weird thing is that you never specify the number of images in the image strip - but AddStrip() figures it out anyway.
Doh! .AddStrip, so simple. I assumed that they did it in code instead of a built in function of the IL.
I'll try it out, but I'll assume (again) that its straight forward and simple.
Thanks guys
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
May 6th, 2005, 02:33 PM
#7
Re: Bitmap Map - ReOpened :(
Why cant anything be straight forward????
I added the strip as a embedded resource. Then I tried to .AddStrip of the GetType() for the resource, but its
generating an exception on that line.
VB Code:
Me.ImageList1.Images.AddStrip(New Bitmap(Me.GetType(), "24OffLarge-214.bmp"))
tbbNavigation.Buttons.Item(5).ImageIndex = 0
I even tried manually adding the strip to the IL but it doesnt show up on the button.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
May 6th, 2005, 02:53 PM
#8
Re: Bitmap Map - ReOpened :(
Shot in the dark rob, the resource identifier string ("24OffLarge-214.bmp") is CaSe sensitive. Might be worth checking.
I don't live here any more.
May 6th, 2005, 03:02 PM
#9
Re: Bitmap Map - ReOpened :(
I think the issue is the image. The resource editor says it cant be viewed since it contains more the 256 colors,
but it is loaded correctly.
I changed images to an ico file and it didnt error but it didnt show up either. So I turned off the VisualStyles and the ico image now shows.
How do I get the toolbar to draw images while running VisualStyles?
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
May 6th, 2005, 09:46 PM
#10
Lively Member
Re: Bitmap Map - ReOpened :(
I'm a noob and guessing, but did you try to change the Colour Depth property on the ImageList before you resorted to changing the images to *.ico? Its worth a try
May 6th, 2005, 10:22 PM
#11
Re: Bitmap Map - ReOpened :(
Yes, I have the imagelist set to 32 bit in the properties window at design time.
I just resized the IL to match the image strip and I get an error that its too wide - 1128, 256 max.
What can I do? Guess I'll have to slice up the strip into individule pixs?
VB Code:
Me.ImageList1.ColorDepth = ColorDepth.Depth32Bit
Me.ImageList1.ImageSize = New Size(1128, 24)
Dim img As New Bitmap(Me.GetType(), "24OffLarge-214.bmp")
Me.ImageList1.Images.AddStrip(img)
tbbNavigation.Buttons.Item(5).ImageIndex = 1
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
May 7th, 2005, 05:59 AM
#12
Re: Bitmap Map - ReOpened :(
Hi,
No need to slice - it works fine for me without the gettype. The imagesize property of the imagelist needs to be the size of the individual images - the imagelist automatically calculates how many there are by dividing up the strip. If your strip is 32x16 pixels and you set the image size to be 16x16, even M$ can figure out how many images there are there.
If instead of your Me.Gettype, you just hardcode in the filename and set the image size to be 16x16 (or whatever) then it'll work. Your problem is not with the method, it's the embedding bit.
HTH
zaza
May 7th, 2005, 11:20 AM
#13
Re: Bitmap Map - ReOpened :(
Yes, I have two issues, embedding and adding. I looked all through the help files and there is only one small page on .AddStrip. No
where did it say to set the width to the individule pixs but that makes 100% sense. I will test it out.
I need the GetType since I need my files to be embedded resources and not be located on the fs.
Thanks zaza I will post back.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
May 7th, 2005, 12:10 PM
#14
Re: Bitmap Map - ReOpened :(
Ok, got the strip added and images associated with each button.
Two things:
1. Doesnt draw on the VisualStyle layer.
2. The black area is displayed. Probably needs a mask or transparency color designated.
VB Code:
Me.ImageList1.ColorDepth = ColorDepth.Depth32Bit
Me.ImageList1.ImageSize = New Size(24, 24)
Dim asm As Reflection.Assembly = Me.GetType().Assembly()
Dim img As New Bitmap(asm.GetManifestResourceStream("24OffLarge-214.BMP"))
Me.ImageList1.Images.AddStrip(img)
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
May 7th, 2005, 03:37 PM
#15
Re: Bitmap Map - Almost Solved
This is a shot of it without the visual styles applied. If I turn on the vs then the vs draws over the layer that the
arrows are drawn on. The vs are drawn on a different top level layer.
Any ideas on how to draw on the theme layer and eliminate the black?
Attached Images
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
May 7th, 2005, 05:50 PM
#16
Re: Bitmap Map - Almost Solved
Got a little farther. I found the .TransparentColor property of the imagelist, Doh!
VB Code:
Me.ImageList1.TransparentColor = Color.Black
Now still need to draw on the visualstyle layer and is there a way to make the images smoother, less jaggie?
Attached Images
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
May 8th, 2005, 01:00 PM
#17
Re: Bitmap Map - Almost Solved
If I cant get this solved for the strip then I'm going to have to find another way to create the images with smoothing effects.
As for the drawing on the visual style layer, I found some Theme APIs that may do the trick but I think thats a new thread.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
May 8th, 2005, 02:47 PM
#18
Lively Member
Re: Bitmap Map - Almost Solved
Rob, try investigate in how to apply a blur onto the images. In VB6 I remember an effect that I saw in an example which would blur an image by a specified value. That would make the images smoother.
May 8th, 2005, 02:53 PM
#19
Re: Bitmap Map - Almost Solved
Wouldnt that blur the entire image? I know there is AntiAliasing for text, I'm hoping there is something similar to your suggestion.
I'll try a look. Thanks.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width