Just as the title says , i have been trying to do this for hours but i need help now .
Has anyone got any ideas on this , i know you have to get the memblock pointer but i`m stuck now .
below i have tried to do this but its prolly way out .
to save confusion i am using the plugin sdk which looks like the gdk.
DWORD width = dbMemblockDword(memnum,0);
DWORD height = dbMemblockDword(memnum,4);
DWORD bpp = dbMemblockDword(memnum,8);
int size = height*width*bpp/8 ;
BYTE *bits = new BYTE[ size ];
bits = (BYTE*)dbGetMemblockPtr(memnum);
HBITMAP hbmp = CreateBitmap(width , height , 1 ,bpp ,&bits);
thanks for any help chunks .
EDIT :
I have finally sussed it out so here it is for anyone else , you could use the same code in gdk too.
int memblock = 1;
dbMakeMemblockFromImage(memblock,id1);
int w = dbMemblockDword(memblock, 0);
int h = dbMemblockDword(memblock, 4);
int bpp = dbMemblockDword(memblock, 8);
int size = dbGetMemblockSize(memblock)-12;
BYTE *lpBits = new BYTE[ size ] ;
//dbCopyMemory((DWORD)lpBits , dbGetMemblockPtr(memblock),size);
memcpy(lpBits ,(void*) dbGetMemblockPtr(memblock),size);
HBITMAP hbmp = CreateCompatibleBitmap(dc ,w ,h);
SetBitmapBits(hbmp,size,lpBits);
thanks chunks
nvidia geforce 9500gt + amd athlon 64
windows xp pro.