@all
I’m having trouble creating a bitmap object when using memory data instead of loading from files.
My goal is to embed small image data directly into the main binary by converting images into raw byte arrays, rather than loading them from disk. However, no matter what I’ve tried—whether using the datatypes.library to convert PNG images to raw data or creating raw ARGB data manually—I consistently fail to create the bitmap object.
For example, this approach always works:
Image = IIntuition->NewObject(BitmapClass, NULL,
BITMAP_SourceFile, "file",
BITMAP_SelectSourceFile, "file_s",
BITMAP_Screen, (ULONG)pubscreen,
BITMAP_Masking, TRUE,
TAG_END);
But this one doesn’t:
Image = IIntuition->NewObject(BitmapClass, NULL,
BITMAP_BitMap, (ULONG)normalBitmap,
BITMAP_SelectBitMap, (DWORD)selectBitmap,
BITMAP_Screen, (ULONG)pubscreen,
BITMAP_Masking, TRUE,
TAG_END);
I’ve tried using datatypes.library to handle PNG data and also manually creating a bitmap from ARGB chunks, but neither worked. Is there a way to make this work without loading a bitmap file from disk?
Does anyone know a proven method to load a memory chunk directly into a BitmapClass object without relying on file-based input?
All i want it just : unsigned char cancel_s_png[844] = { 0xXX,0xXX,...etc.. }; then take this one and create bitmap image from. Of course i can go easy way, just on run create images in the T:, and then use them as sourcefiles, but while T: stand for temporary files, i really want to avoid creating any file anywhere, and just deal with standalone binary.
Edited by kas1e on 2025/5/30 8:31:50
Edited by kas1e on 2025/5/30 8:50:18