hi
I search a code to show .png pictures from resource.This is for bitmaps:
#include <DarkGDK.h>
#include "resource.h"
#define IMAGENUM 1
#define MEMBLOCKNUM 1
void DarkGDK(void)
{
HBITMAP hMiniBitmap = LoadBitmap(GetModuleHandle(0), MAKEINTRESOURCE(IDB_BITMAP1));
if (hMiniBitmap)
{
// Get the size of the bitmap
BITMAP bitmap;
::GetObject(hMiniBitmap, sizeof(BITMAP),&bitmap);
int size = bitmap.bmHeight*bitmap.bmWidth*bitmap.bmBitsPixel/8;
// Get the bitmap data from the resource
BYTE *lpBits = new BYTE[ size ];
::GetBitmapBits(hMiniBitmap, size, lpBits);
// Copy the bitmap datato a memory block
dbMakeMemblock(MEMBLOCKNUM, size + 12);
for (int i=0; i<size; i++)
dbWriteMemblockByte(MEMBLOCKNUM, i+12, lpBits[i]);
dbWriteMemblockDWORD(MEMBLOCKNUM, 0, bitmap.bmWidth);
dbWriteMemblockDWORD(MEMBLOCKNUM, 4, bitmap.bmHeight);
dbWriteMemblockDWORD(MEMBLOCKNUM, 8, bitmap.bmBitsPixel);
// Cleanup
delete []lpBits;
dbMakeImageFromMemblock(IMAGENUM, MEMBLOCKNUM);
}
while (LoopGDK() && dbScanCode() == 0)
{
dbPasteImage(IMAGENUM, 0, 0);
dbSync();
}
}
but how i can this with png pictures?