[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Problem with ToolboxBitmap property when creating ActiveX control

Posted on 2001-09-11
11
Medium Priority
?
189 Views
Last Modified: 2007-12-19
Hi,

I am trying to set the ToolboxBitmap property of my control to a bitmap I have made. As stated I have made the bitmap 16 x 15 pixels.

However the bitmap is always displayed incorrectly in the toolbox. For some reason all the black is being removed from the picture.

Why is this happening and how do I stop it?

Thanks

PyroMyst
0
Comment
Question by:pyromyst
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 3

Expert Comment

by:SirNick
ID: 6473757
Is it a .ico or .bmp picture?
0
 
LVL 1

Author Comment

by:pyromyst
ID: 6473766
It's a bitmap. I have also tried .jpg but I had the same result.
0
 
LVL 3

Expert Comment

by:SirNick
ID: 6473769
If you double click the picture in the toolbox does it still bring up an instance of your control?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Author Comment

by:pyromyst
ID: 6473799
Yes it does. I have actually compiled and tested it as a .ocx successfully.

I then tried to give it a custom toolbox bitmap but it only shows the remaining colours after removing all black pixels.
0
 
LVL 3

Expert Comment

by:SirNick
ID: 6473814
I see you made a bitmap 16 x 15 pixels.  Have you tried making one 16 x 16, because I thought that whenever you use a bitmap for this purpose it is like using an icon file which are usually 16 x 16 or 32 x 32 or am I wrong.  It could be slightly distorted therefore removing the black.

Is the black areas around the edges or in the centre of the bitmap.
0
 
LVL 1

Author Comment

by:pyromyst
ID: 6473897
I haven't tried 16 x 16 because the help in MSDN said that the bitmap should be 16 x 15 otherwise it would be scaled.

The black is as a border and in the center. All other colours appear undistorted.

It seems almost as if it is treating black as a mask because where the black should be it is transparent.
It should work because in the help they suggest using black, white and greys suggesting to me that black should appear normally.
0
 
LVL 7

Accepted Solution

by:
Vbmaster earned 40 total points
ID: 6474069
The color of upper left corner will be the transparent color. And because your bitmap has a black border the upper left corn is black -> black is the transparent color -> all black pixels will be transparent.
0
 
LVL 1

Author Comment

by:pyromyst
ID: 6474201
Are you sure about that?

I have just tried changing the upper left pixel to white, however white still appears and my black is still missing. Furthermore I can see the white pixel in the upper left corner.
0
 
LVL 1

Author Comment

by:pyromyst
ID: 6474385
I carried on investigating and your idea is correct. However it is the lower left corner that determines the transparent colour, not the upper left.

Is there anyway around this? I don't like having a corner missing from my border.
0
 
LVL 2

Expert Comment

by:JanusFury
ID: 6478197
nope, no way around it. I hate ToolboxBitmap.
0
 
LVL 1

Author Comment

by:pyromyst
ID: 6478740
Thanks for your quick help Vbmaster, and thank you JanusFury for answering that last question of mine.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question