Available in the LEADTOOLS Imaging toolkit. |
DDB example for C++ 4.0 and later
This example copies the Lead1 bitmap to the clipboard as a DDB. It pastes the DDB into Lead2 and reverses the image. It then gets a DDB from Lead2, sets the same DDB to Lead1, and repaints.
BeginWaitCursor();
int MyFlags = COPY_EMPTY + COPY_DDB + COPY_PALETTE;
m_Lead1.Copy(MyFlags);
m_Lead2.Paste(0);
m_Lead2.Reverse();
OLE_HANDLE MyDC = m_Lead2.GetClientDC();
OLE_HANDLE MyDDB = m_Lead2.GetDDB(MyDC);
OLE_HANDLE MyPalette = m_Lead2.GetPalette(MyDC);
m_Lead1.SetDDB(MyDC, MyDDB, MyPalette);
m_Lead1.ForceRepaint();
m_Lead2.ReleaseClientDC();
DeleteObject((HBITMAP) MyDDB);
DeleteObject((HPALETTE) MyPalette);
EndWaitCursor();