NSButton's images lose transparency on selection - cocoa

I have edited some NSButtons in my Mac OS X application and set a custom image to them. The images are in png format with transparency. When I select a button, the background of the image goes white.
Does anyone know of a way to fix this?

The issue was that I was customising a 'Bevel' button. I changed the button bezel to 'Square' and changed the button type to 'Momentary Change'.
Hope this helps some people in the future!

Related

xamarin three-choice button color

I am using the Three-choice Button component in xamarin, but I don't know of a way to change the button color. The font and shadow ect can be changed, but I would like to change the grey color.
Can anyone provide some insight on how to do this?
I solved this a different way. I am using a normal ios switch, and just changing the background colour of the switch, ie Green, Grey or Orange.
Not exactly the answer to my question, but looks neater than the component did.

In XCode 8, how can I make an image button with padding?

I have an button, and I told it which 'image' to use (setting the image in 'background' works too). I would like to make the image inside the button to be smaller than the button. I tried changing the content insets, the title insets, and the image insets, but none of them seem to be working. The content and image insets scoot the image around, but do not make it smaller.
I would like to accomplish this in the main.storyboard, and not do it programmatically, if possible.
Not the best solution but if you need any easy work around you can add the image as an UIImageView and then add a clear button over it with the padding u need

Highlight selected image in Windows Phone XAML?

I am currently using the Image control in XAML, when the user taps on the image I want to display another image like a tap effect*, so for example I want to make the image a bit darker or lighter once the user taps on it, how can I do this using the image control?
I've managed to fix this with adding a new image to the mousebuttonup, mousebuttondown and mouseleave event of the image control
You could place a collapsed image with the same size at the same position as the first one. If the user taps the image, you show the previously collapsed image.
If you want to make your first image darker, set the background of your hidden image to black and opacity to 0.25 or something like this. When it gets visible your first image will be slightly darker.
Instead that you can try to customize the style of your button. In Visual State>>Pressed>>You can change the Color or you can give some animation as well.
tHANKS,

QT QPushButton with an icon and overlaid centered text

I recently took to Qt Programming and want to port my app to Qt.
I'm fiddling with QPushButtons and I've managed to display an image into the button and to set some text to the button but, whatever I do, with or without the designer,
I have the same problem, the text is aligned right to the icon instead of being overlaid over the icon.
addButton = new QPushButton();
addButton->setIcon(QIcon(":/AddButton.png"));
addButton->setText(tr("+"));
addButton->setFlat(true);
addButton->setIconSize(QSize(100,90));
What am I missing ?
I know there is the toolButton but it doesn't seem to have the "flat" property.
Any idea please ?
Thanks a lot,
Mike
If you are trying to use your image as a background image, you can use a style sheet:
addButton->setStyleSheet("background-image: url(:/AddButton.png);"
"background-repeat: no-repeat;"
"background-position: center center");
You'll just have to make sure the size of your button is at least as big as the image.

How to make an image as transparent in BlackBerry?

I am new to BlackBerry Java application development. My scenario is: In my application a gallery list of images will be displayed in a small icons. If I click on any image it will display in a large mode. Here I need to provide controls like front and back buttons. On clicking on those buttons the background image should change. In addition to that those buttons should be highlighted and the back ground large image should be transparent. How to do this?
Please guide me.
You can use Graphics.setGlobalAlpha() on paint() or to modify bitmap before preview.
Don't forget to set back normal global alpha value after bitmap drawing.

Resources