Hi everybody.
I found some code from vortex(thanks) on the forum that loads bmp file into memeory so you can display it. I was wondering how can I change it so it can load a png or a jpg
here is the meat of the code
invoke GetClientRect,[hwnd],client
lea eax,[pBitmap+14] ; start of BITMAPINFOHEADER header
invoke CreateDIBSection,0,eax,DIB_RGB_COLORS,ppvBits,0,0
mov [hBitmap],eax
lea eax,[pBitmap+54] ; + sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER)
stdcall MemCopy,eax,[ppvBits],149346-54 ; copy bitmap's bit values
it looks like the file header is 54 bytes or 14 bytes so how would I change it to work with a png or jpg? I read that png is 8 bytes so I changed all the numbers to 8 and it did not work. It is probably an easy fix but I am not that great at assembly yet.
thanks so much!