Tomb64
asked on
DIB to DIB
how can I copy the BitBlt and StretchBlt, but from a DIB to a DIB?
I would like a Win32 API, but C/C++ code to manually do that would be fine, if its decently fast
I would like a Win32 API, but C/C++ code to manually do that would be fine, if its decently fast
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Its harder if you want to copy only a portion of the DIB or change its storage format. While you can do this by copying the information manually, like a complex version of the example above. i think the easest way would be to just copy the image from the source DIB to a memory DC using SetDIBIts() and then copy image out the memory DC to a destination DIB in the new format using GetDIBits().
***Blt work with CreateDIBSection().
void *SrcDat = ????;
BITMAPINFO DstBmp;
int DatSiz;
void *DstDat;
DatSiz = SrcBmp.bmiHeader.biSizeIma
if (DatSiz == 0)
{
int BitWdt = SrcBmp.bmiHeader.biBitCoun
int BytWdt = ((BitWdt >> 3)+ 3) && 0XFFFFFFFC
DatSiz = BytWdt*SrcBmp.bmiHeader.bi
}
DstDat = new char[DatSiz];
DstBmp = SrcBmp;
memcpy(DstDat,SrcDat,DatSi
continues