1

PixelFormat32bppARGB 形式の Gdiplus::Bitmap (C++) があり、次を使用して PixelFormat32bppRGB に変換します。

        Gdiplus::Bitmap* bitmapRGB = new Gdiplus::Bitmap(bitmap->GetWidth(), bitmap->GetHeight(), PixelFormat32bppRGB);
        Gdiplus::Graphics graphics(bitmapRGB);
        graphics.DrawImage(bitmap, Gdiplus::Point(0, 0));

RGB-Bitmap の形式を確認すると、正しいです (RGB):

bitmapRGB ->GetPixelFormat() == PixelFormat32bppRGB

ビットマップを保存してそのフォーマットを確認すると (つまり、Gimp で)、4 番目のチャネルがあります。

    CLSID pngClsid;
    GetEncoderClsid(L"image/png", &pngClsid);
    bitmapRGB ->Save(path, &pngClsid, NULL);

RGB-Pixelformat で png を取得するにはどうすればよいですか?

4

1 に答える 1