HI Marinus
Tks, but, still not working

Im clueless on what could be the error.
The inputted data from the rsrc section (with the BitmapInfoheader) is like this:
; This data is extracted directly from the resources section without any loadresources api envolved, neither lock etc. I simply get the PE address, point to it and copy on a buffer with VirtualAlloc api.
; BITMAPINFOHEADER structure
[OutBmpHdr:
OutBmpHdr.biSize: D$ 40
OutBmpHdr.biWidth: D$ 75
OutBmpHdr.biHeight: D$ 46
OutBmpHdr.biPlanes: W$ 1
OutBmpHdr.biBitCount: W$ 8
OutBmpHdr.biCompression: D$ &BI_RGB
OutBmpHdr.biSizeImage: D$ 3496
OutBmpHdr.biXPelsPerMeter: D$ 3790
OutBmpHdr.biYPelsPerMeter: D$ 3780
OutBmpHdr.biClrUsed: D$ 0
OutBmpHdr.biClrImportant: D$ 0
Followed by the Pixel data of the image.
PixData: B$ 0, 0, 0, 0, 080, 080...........]
I read the example and tried this:
[pImage: D$ 0]
......
mov eax D$esi+RosAsm_Rsrc_Data.PtrDis ; Initial address of the image data in OutBmpHdr (Stored on a Buffer with VirtAlloc)
mov ecx eax
add ecx Size_Of_BITMAPINFOHEADER
mov D@pBits ecx ; <---- True BitMap Pixel data at "PixData"
; get the width and height
mov eax D$esi+RosAsm_Rsrc_Data.PtrDis
mov ecx D$eax+BITMAPINFOHEADER.biWidthDis | mov D@ImgWidth ecx
mov ecx D$eax+BITMAPINFOHEADER.biHeightDis | mov D@ImgHeight ecx
; Tried to create a new image with PIXELFORMAT_32BPPRGB = 022009h
; Where pImage is the variuable to store the pixel data after created from memory to gdiplus
; The below function returns S_ok.
call CreateImageFromMemory D@pBits, D@ImgWidth, D@ImgHeight, pImage, PIXELFORMAT_32BPPRGB
And then tried to convert with
call 'kernel32.MultiByteToWideChar' &CP_ACP, 0, OtherSaveFilter, 0-1, FilenameW, (&MAX_PATH-1)
mov ecx Image_BMP | mov eax CLSID_ImageType | mov B$eax cl
call 'gdiplus.GdipSaveImageToFile' D$pImage, FilenameW, eax, &NULL ; This is the error. Returned a value of 7 (Same buffer problem)
maybe the error is inside CreateImageFromMemory ? Because the image is 8 bpp and not 32bpp ? If is that so, how to properly identify or convert a image without using hdc etc, just the plain and simple gdiplus fucntions ?
Proc CreateImageFromMemory:
Arguments @ImgBits, @ImageWidth, @ImageHeight, @pImage, @PixFormat
Local @Stride
Uses ecx, edx
mov eax D@ImageWidth | shl eax 2
call 'gdiplus.GdipCreateBitmapFromScan0' D@ImageWidth, D@ImageHeight, eax, D@PixFormat, D@ImgBits, D@pImage
EndP
I read at
https://stackoverflow.com/questions/39312201/how-to-use-gdi-library-to-decode-a-jpeg-in-memory that we can use SHCreateMemStream directly to try to convert, but how to do it ??? I tried this too, but, nothing :(
IStream* stream = SHCreateMemStream(buf, bufsize);
Gdiplus::Image *image = Gdiplus::Image::FromStream(stream); ; <--- I believe it is actually pointing to GdipCreateBitmapFromStream, right ?
...
stream->Release();