Why is my FloatingActionButton icon black? the picture inside it turn to black - action

Why is my FloatingActionButton icon black? the picture inside it turn to black

Related

BMP transparent color key not displaying correctly

I'm using a C++ class called CSplash which is used to display a splash window in the center of the screen. It is designed to load only bitmap file types. It allows an RGB transparent color key to display the BMP with a transparent background.
I have a PNG image.
I opened this image in Photoshop and added a background color (50, 200, 25) as a transparent key.
I then save this image as a bitmap file in my project.
I am left with a file: PowerUp.bmp
In my C++ code, I imported the class mentioned above and in WM_NCCREATE I have the following code:
CSplash splash = CSplash("PowerUp.bmp", RGB(50, 200, 25));
splash.WindowProc(hWnd, uMsg, wParam, lParam);
splash.ShowSplash();
splash.DoLoop();
When I run my program, the splash image shows with a transparent background, but not as expected. The result has some of the transparent color left around the icons.
How can I fix this to make it look exactly like the transparent original PNG file?
The problem as I see it is that you original png image has transparent parts (glasses borders are not strictly opaque but more like smoothly transitioning to transparent), which is a common case. So having absolutely green background with this image above it results in green being altered a bit around glasses border and other images. And it is no longe (50, 200, 25), it could be (51, 201, 25) and no longer removed by CSplash.
What you need to do is save you original PNG in transparent format where alpha channel is only 1 bit (0 or 1, transparent or opaque) - thus transitions will be lost, reopen it, and the do the green background trick again.

how to remove border or change border color of CHeaderCtrl (mfc)

How to remove border or change border color of CHeaderCtrl? In my case CHeaderCtrl is embedded in CListCtrl (we are not calling CHeaderCtrl::create explicitly from our code). I would like to remove this white border from header or would like to change the border color.

Win32 Edit Controls of WS_EX_LAYERED parent dont receive mouse/click events when their background is transparent

I want to put some edit fields ontop of a splash screen which is rendered in another top level window (transparent PNG similar to this http://code.logos.com/blog/2008/09/displaying_a_splash_screen_with_c_part_ii.html) .
I made a secondary window which is always on top of my splash screen, and made it also transparent with WS_EX_LAYERED.
Now i set the background color of the edit fields in the wndproc by catching WM_CTLCOLOREDIT.
This works fine, my input controls are transparent (e.g. invisible) and only the entered text is visible on the splash screen.
Now the issue comes that the mouse cursor which indicates here is a text box does not work, neither can i click in that box to have it focus. The problem all disappears if i do NOT make the background of the edit control transparent. There is also no WM_NCHITTEST when its transparent. The only time im getting a mousecursor is if there is (visible)text already entered in the box
g_HWNControlsParent = CreateWindowEx( WS_EX_LAYERED,.....);
hwLoginField = CreateWindowEx(NULL,"EDIT", "-User-", WS_CHILD|WS_VISIBLE|WS_TABSTOP, ....g_HWNControlsParent);
SetLayeredWindowAttributes(g_HWNControlsParent,RGB(0, 0, 0), 0, LWA_COLORKEY) ;
in HWNControlsParent wndproc
case WM_CTLCOLOREDIT: { // BG Color of Input Fields
HDC hdc = (HDC)wParam;
SetTextColor(hdc, RGB(230,230,230));
SetBkColor(hdc, RGB(0,0,0)); // Color of Background where Text is entered
SetDCBrushColor(hdc, RGB(0,0,0)); // Color of Background where no Text is
return (LRESULT) GetStockObject(DC_BRUSH); // return a DC brush.
}
If you use an alpha of 1 instead of 0 for the transparent regions, they will still be transparent but will respond to mouse clicks.

How to set a transparent image as a background?

I want to display a fullscreen transparent image anytime there is an active menu button in cocos2d. How do I do that?
If you're looking to provide a popup dialog underlay, you can use CCLayerColor:
CCLayerColor* underlay = [CCLayerColor layerWithColor:ccc4(0, 0, 0, 127)];
[self addChild:underlay z:(something less than your button's z)];
If it has to be a specific image, initialize the image and do the second line above using your CCSprite.

How can I draw a selection rectangle on the screen with Qt?

How can I draw a selection rectangle on my screen with Qt in X11?
I want to be able to drag a rectangle on my screen (outside of the application) and then save the whole rectangle.
Thanks in advance.
Part of the solution will involve using the grabWindow() function of QPixmap like so:
QPixmap::grabWindow(QApplication::desktop()->winId());
Qt has an example program for this here.
There rest of the solution, drawing the area to grab, can probably be achieved by either using a full screen transparent window to render a mouse drawn rectangle and then taking the section it outlines from the grabbed desktop image or using a full screen window with the entire grabbed screen painted on it.