aewarnick
June 11th, 2005, 11:31 AM
aBmp* b= setts.imArr[imList.SelInd()]->bmp;
ushort sizeofBmpInfoHead= sizeof(BITMAPINFOHEADER);
BITMAPINFO bi;
memset( & bi.bmiHeader, 0, sizeofBmpInfoHead);
bi.bmiHeader.biSize= sizeofBmpInfoHead;
bi.bmiHeader.biWidth= b->W;
bi.bmiHeader.biHeight= b->H;
bi.bmiHeader.biPlanes= 1;
bi.bmiHeader.biBitCount= b->bpp;
uint sz= sizeof(bi)+b->WBits*b->H;
char* c=new char[sz];
memcpy(c, &bi, sizeof(bi));
memcpy(c+sizeof(bi), b->pBits, b->WBits*b->H);
CB::ToCB_Bmp(Hwnd, c, sz);
delete[]c;
//...more code...
::SetClipboardData(CF_DIB, hGlobal);
Did I do something wrong there. This works but the colors are all messed up and the images are 24 bit.
ushort sizeofBmpInfoHead= sizeof(BITMAPINFOHEADER);
BITMAPINFO bi;
memset( & bi.bmiHeader, 0, sizeofBmpInfoHead);
bi.bmiHeader.biSize= sizeofBmpInfoHead;
bi.bmiHeader.biWidth= b->W;
bi.bmiHeader.biHeight= b->H;
bi.bmiHeader.biPlanes= 1;
bi.bmiHeader.biBitCount= b->bpp;
uint sz= sizeof(bi)+b->WBits*b->H;
char* c=new char[sz];
memcpy(c, &bi, sizeof(bi));
memcpy(c+sizeof(bi), b->pBits, b->WBits*b->H);
CB::ToCB_Bmp(Hwnd, c, sz);
delete[]c;
//...more code...
::SetClipboardData(CF_DIB, hGlobal);
Did I do something wrong there. This works but the colors are all messed up and the images are 24 bit.