DDB example for Visual J++

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.

setCursor( Cursor.WAIT );  // hourglass
int nMyFlags = LTOCXU.CopyConstants.COPY_EMPTY | LTOCXU.CopyConstants.COPY_DDB | LTOCXU.CopyConstants.COPY_PALETTE;
LEAD1.Copy( (short) nMyFlags );
if( LEAD2.Paste( (short) LTOCXU.PasteConstants.PASTE_ISREADY ) == 0 )
   MessageBox.show( "Invalid data on the clipboard" );
else
   LEAD2.Paste( (short) 0 );

LEAD2.Reverse();
int hMyDC = LEAD2.GetClientDC();
int hMyDDB = LEAD2.GetDDB( hMyDC );
int hMyPalette = LEAD2.GetPalette( hMyDC );
LEAD1.SetDDB( hMyDC, hMyDDB, hMyPalette );
LEAD1.ForceRepaint();
LEAD2.ReleaseClientDC();
setCursor( Cursor.DEFAULT );  // default