Transparent Image on Command Button

evanscamman

Registered User.
Local time
Today, 13:46
Joined
Feb 25, 2007
Messages
274
I would like to have more options than the 60 or so generic images that come up when you click the ... in the picture field of a command button. But, I can't figure out how to save a BMP in a way that Access will load transparently. Has anybody made their own transparent BMP and put it in a command button?

I am using Access 2007, XP SP3 - but had the same problem with Access 2003.

Thank you,
Evan
 
Evan,

Check out:
free tool


Hope this helps...

Hitechcoach:

I am trying to do the same thing. The images that come with Access look like they are from Windows 95 and Access hasn't updated them. The problem is getting transparent backgrounds on the images I want to use. It's easy to get a GIF or PNG with a transparent background using GIMP or similar program. But when you import it as your button image, Access gives an error message.

Lebans' solution to getting transparent backgrounds coverts the image into an EMF. However, you cannot use an EMF on a button (unless there's some technique that I'm not aware of).

I'd colour the background the same colour as the button, BUT the button's colour is set by the system so every computer will have the button looking different. Anyone with different Windows settings will have a coloured square around the image rather than having it blend nicely.

Does anyone have a solution that works?

SHADOW
 
isnt a transparent background what an icon uses? or is it more complicated than that
 
There are millions of free icons, ico's available on the net;)
 
There are millions of free icons, ico's available on the net;)

True, but can you use the icons with transparency on a Command Button? I've saved GIFs and ICOs with transparency and they won't import into a command button graphic. It gives an error message.

SHADOW
 
I believe the button image can only accept bmp formats.
 
I believe the button image can only accept bmp formats.

That's certainly possible. However, when I try to import a GIF, it says that it should be converted to GIF or BMP.

If, indeed, the button image can only accept BMP, then are we stuck with a printer icon that looks like it's from the early 90s (ditto for the other icons) or is there a workaround that will allow decent-looking buttons (without replacing them with coded ractangles or other "tricks")?

SHADOW
 
True, but can you use the icons with transparency on a Command Button? I've saved GIFs and ICOs with transparency and they won't import into a command button graphic. It gives an error message.

SHADOW
Unless it's been changed Icos can be used, use the browse options to attach them
 
Rich is correct there. ico's are fine too. Buttons don't allow image transparency. There's really no workaround (at the moment).
 
Unless it's been changed Icos can be used, use the browse options to attach them

That works great unless there's a transparent background. I can use the same image in a button, then go to GIMP, put in the transparency and save it and it fails.

SHADOW
 
Rich is correct there. ico's are fine too. Buttons don't allow image transparency. There's really no workaround (at the moment).

I kind of suspected that. Access is stuck in the 90s in how it looks unless you're willing to completely change your buttons and create your own controls (which I've done) but it's a lot of work.

Thank you

SHADOW
 
Why the need for transparency?
 
It can be a hassle lol. How did you go about it?

Multiple rectangles that turn colour when you hover over them, having the one hovered over become invisible to "show" the one underneath that's a different colour and slightly down and to the right. More mousemove events (i.e placed in the other controls of the form) will reverse it. It gets really complicated if you have a bar of these "buttons" such as "Add", "Delete", "Edit", "Print", "Close". Instead of being able to implement this in 5 minutes, it can take an hour to get working and debugged with all the controls positioned correctly. I'll add that if you're not careful about the code, you can have a situation where the mousemove event triggers with every time the user moves the mouse and the whole screen flickers. (Someone else on the forum had this problem and I posted a solution to him).

SHADOW
 
Why the need for transparency?

Imagine the graphic that I have (let's say a printer that doesn't look like it's from the 80s) has a white background. I want it to display on a button without the white background to blend with the button face the way all the Access graphics do. If you give the graphic the same colour as your button face, then it will look wrong on other computers. The reason for this is that the button face colour is determined by Windows settings. So, you end up with a button with a grey square around the printer on one computer, or a tan one on another and so on.

As I noted, it's easy to replace the white with a transparent background and convert it to PNG or GIF, and it's sort of easy (using the workaround of pasting into Word) to get that to display on a form. But it seems that you are STUCK if you want it on a button.

It seems like Access programmers are stuck with a lot of workarounds to achieve simple goals.

SHADOW
 
Sounds very complicated. You could have created just two rectangles and move them to the buttons when it's hovered over by setting their top and left properties to the button's top and left. You can also set the width and height of your rectangles to that button's height and width. All this would be in a module and all you do is call the function. Here's a thread that might help too.
http://www.access-programmers.co.uk/forums/showthread.php?t=187721
 
Sounds very complicated. You could have created just two rectangles and move them to the buttons when it's hovered over by setting their top and left properties to the button's top and left. You can also set the width and height of your rectangles to that button's height and width. All this would be in a module and all you do is call the function. Here's a thread that might help too.
http://www.access-programmers.co.uk/forums/showthread.php?t=187721

Then how do they "move" when you click if they are positioned with the same top and left?

For that matter, you can use one rectangle and programatically change its colour when hovered or clicked. I suppose you could make it move as well.
 
All the Icos I've ever used completely cover the button face anyway
 

Users who are viewing this thread

Back
Top Bottom