How to keep transparency of PNG image for ScaleImageLabel? - codenameone

I've added a PNG with transparent background as MultiImage to a theme and tried to use it for ScaleImageLabel:
ScaleImageLabel logoLabel = new ScaleImageLabel(theme.getImage("sign-up--logo.png 1"));
The Codename One Designer shows the image as it should be, with transparency:
But simulator paints the transparent area white:
What should be done to keep the background of the PNG image transparent?

logoLabel.setUIID("Container");
Generally the opacity comes from the Label UIID so you can style Label to have a transparency value of 0.

Related

Canvas background color not as white as I need

I am setting the background color of my Canvas as 'white'. However when I compare my canvas with a vendor application, their canvas is 'whiter', which is the color I want for my canvas too. I have looked at all the color choices available for canvas background color but nothing makes my canvas any whiter than it is. Any suggestions would be appreciated.
Simple solution:
Use one of the browser plugins to get the actual "white" color of their app.
One example of a color-picker is Chrome plus the ColorZilla extension:
https://chrome.google.com/webstore/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp

How to overlay white text on a white background in WPF so that it is viewable

My WPF VS 2008 application is working with many different images that are assembled and displayed at runtime. I would like to display some white text on top of those images. My problem is that some images contain a white or light color background.
My question is - is it possible to somehow specify a property or specify a setting in the image object, BitmapImage object (where the image is loaded from), or some other WPF object such that when white pixels from one image overlap white pixels from the other image - they turn a different color so the text will be viewable?
I think it depends on how you 'draw' your text on the images. If you use e.g. a Label, you can try out the 'DropShadowEffect', see: http://msdn.microsoft.com/en-us/library/ms748273.aspx
This effect should work with all WPF objects and you can try out some transparent black soft shadows surrounding the text (a little bit like a glow).
This will only be visible in bright environments if you adjust the opacity right.
Decided to use a dark background color for the text that is only partially (.35) opaque. This means that the background color of the image comes through for the most part, but for lighter colors it yields enough contrast so that the text is viewable.

how to Paint non-client area in winForms transparent? .Net 4

im developing a custom form and i want that the non-client area be transparent. im handling the non client area painting via message number "0x85" and this is what i have tried so far:
Paint using the color "Color.Transparent" -> the non-client area was painted black. If I had used an image of red or black or green, it works perfectly, but transparent = black
Created a transparent image of the size of the form and used the method "myGraphics.DrawImage("img.png")". the background remained black. If I had used an image of red or black or green, it works perfectly also...
Not paint anything (hoping that i just would stay transparent)... not worked
Getting parts of a window transparent requires hardware support, a video adapter feature called layering. Use the form's TransparencyKey property. Set it to an unusual color, like Color.Fuchsia. And draw with that color to get the video adapter to omit the pixels.

WPF Image Overlay

I have an <Image /> used in a ControlTemplate to show a 24 bit PNG. Ontop of this, I'd like to apply a semi-transparent gray layer to make it appear half disabled. The problem I'm having is that if I just apply a gray layer, the transparent parts of the image just change to gray, instead of staying transparent and only applying to the coloured parts.
You could set the Opacity of the Image instead.

Picturebox transparency

can anyone help me how to apply transparency on picturebox on Winforms? I have a panel as a main container having a background picture, and I have a picturebox which overlapped on it. So all I need is to have a transparency on picturebox.
Set the Backcolor property of the PictureBox to Transparent.
Ofcourse, make sure that the image you're using is transparent as well (i.e. no background color).
Go to the properties of the PictureBox and set the Back Color to "Transparent".
With code you can do it like:
pictureBox1.BackColor = Color.Transparent;

Resources