SetWindowIcon error: must be in R8G8B8A8 pixel format - raylib c++ - c++

So I am trying to make a window icon for the game and when I load the icon.png image, it says this: WARNING: GLFW: Window icon image must be in R8G8B8A8 pixel format and here is my icon: Finally, here is the code snippet:
Image icon = LoadImage("pong.png");
SetWindowIcon(icon);
Thanks for all answers!

Your icon PNG has a bit depth of 24 which means it's missing the alpha channel (the A8 from R8G8B8A8).
Edit the image to save it with the alpha channel. You can check the bit depth in the file properties (should be 32 for RGBA).

Related

Paint application Qt

I am trying to create a simple paint application using Qt Creator. I want to have a rectangular area on QDialog in which I can draw an image using mouse. The image format will be QImage::Format_Mono (Black and white, pixel indexes are either 0 or 1). I will use pixel indexes for simple image processing purpose, which operates on simple 1 and 0 pixel values, so Format_Mono is essential.
Now the application does its job, but the image (painting area) is stuck at left top part (positioned at x=0 and y=0). I want to have rectangular image editor part at any x and y coordinates I want.
To create the image editor I defined a QImage in dialog.h
QImage image;
In constructor of the Dialog I have:
image = QImage(ui->label->size(), QImage::Format_Mono);
image.fill(Qt::black);
As you can see in above code, I have a QLabel named label in my user interface. I want to put the image editor part in that label (or do something similar).
I checked the QImage documentation, but could not find a function to change the position of the image. Or, it would also be good if I could find any other way to put the image (image editor) in QLabel.
What can I do to have that feature in my application?
EDIT: The created image editor part has the same size as the label (as it should be the case), but image editor (QImage) starts at x=0 and y=0 only.

Image overlap with alphachannel doesn't work on QT

I've put two label of the same dimension overlapped on my GUI. On the first, that is on the back there is one image set by the pixmap of the label. The second label has another image set by pixmap that is trasparent in some pixel. During design i can see the back image via the front image. When I execute the program, the trasparent pixel of the second image are transformed into white pixel, so i cant see the back image. I'm using QT 5.10. The image are in .png format.
I've resolved putting autoFillBackground on and i've changed the color of window in palette putting a transparent color

Unable to Set Overlay Image for CListCtrl

I'm trying to display images with overlays in a 'CListCtrl' within an MFC dialog box. The list control is in report/details mode.
I cannot find good documentation for showing overlays on some of my item images.
The code that is failing is shown below. I have a 64x32 bitmap with a folder icon in the first 32x32 pixels, and an overlay image in the second 32x32 pixels (IDB_FOLDERS32_OVERLAY). The bitmap has transparencies that seem to work fine.
CBitmap bm;
bm.LoadBitmap(IDB_FOLDERS32_OVERLAY);
m_ImageList.Create(32, 32, ILC_COLOR32, 2, 1);
int index = m_ImageList.Add(&bm, RGB(0, 0, 0));
ASSERT(index >= 0);
m_ImageList.SetOverlayImage(index, 2);
The last line returns 0, which indicates an error. GetLastError() returns 6 (ERROR_INVALID_HANDLE).
I can't for the life of me find reasonable documentation for how to do this anywhere on the web. Can anyone see what I'm missing?
Jonathan Potter was correct that I needed to include the ILC_MASK flag in order for SetOverlayImage() to returns a value that indicates success.
However, of all the documentation I could find online, nothing provided a complete description of how to do this. I didn't find a single source, for example, that showed what my bitmap should look like.
To make it more complicated, I am using ILC_COLOR32 to signify a 32-bit color bitmap with alpha (transparency) channel. So I don't have a mask and a mask does not appear compatible with alpha channels.
So in the end, I just created a bitmap with two images: The first is a folder, and the second is a folder with my overlay image on top of it. Problem solved.
At this point, it seems pointless to try and figure out if, or how, masks can be created with 32-bit alpha channel bitmaps.

Convert colored picture in monochrome on button event in MFC SDI application?

I have made an application where in i have to load a btimap and on button event i have to change color depth of the bitmap, I have successfully made the changes for RGB, by manipulating the RGBQUAD of the bitmap. But i am stuck at this point where i want to convert the loaded color bitmap into monochrome on click of button ?
How can this be done ? Can this be also done by manipulation of the RGBQUAD of the bitmap or in some other way. If with RGBQUAD what will be the COLOR VALUE of RGB in case of monochrome.
Please also note that i am able to load the color image and then convert it to monochrome.
Please take a note that this is a SDI MFC application.
Thanks in advance.
Maybe AfxDrawGrayBitmap is what you want.

QLabel doesn't show pixmap

I can't set a png or jpeg image to a QLabel on Windows 7 64.
The image is loaded fine. Indeed QPixmap::load returns true, which means that the loading worked, and QPixmap::width() returns the correct size of the image.
However the pixmap is not displayed when set to a QLabel. The label is visible, the text is displayed, but there is no image.
Even if I don't think it is related to missing plugins (the image is loaded fine) I have tried to add the image formats directory in the working directory like wrote in here
http://www.qtcentre.org/faq.php?faq=qt_images