DIB example for C++ Builder

This example copies the LEADRasterView1.Raster bitmap to the clipboard as a DIB. It pastes the DIB into LEADRasterView2 and reverses the image. It then gets a DIB from LEADRasterView2, sets the same DIB to LEADRasterView1, and repaints.

   long MyDib;
   RasterCopyConstants MyFlags;
   LEADRasterProcess * pRasterProc;

   Cursor= crHourGlass;
   CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
   MyFlags= (RasterCopyConstants)(COPY_EMPTY + COPY_DIB + COPY_PALETTE);
   LEADRasterView1->Raster->Copy (MyFlags);
   if (LEADRasterView2->Raster->Paste (PASTE_ISREADY) == 0)
      ShowMessage ("Invalid data on the clipboard");
   else
      LEADRasterView2->Raster->Paste ((RasterPasteConstants)0);

   pRasterProc->Reverse (LEADRasterView2->Raster);
   MyDib= LEADRasterView2->Raster->GetDIB ();
   LEADRasterView1->Raster->SetDIB (MyDib);
   LEADRasterView1->ForceRepaint ();
   pRasterProc-> Release( );
   Cursor= crDefault;