PatternStyle (ILEADRasterFXD) example for C++ 5.0 and later

   ILEADRasterIO *pRasterIO=NULL;
   ILEADRasterFXD *pRasterFXD=NULL;

   CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
                    IID_ILEADRasterIO, (void**)&pRasterIO);
   CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL,
                    IID_ILEADRasterFXD, (void**)&pRasterFXD);

   m_LEADRasterView1.SetAutoRepaint(FALSE);
   //Load an image for the main control
   pRasterIO->Load(m_LEADRasterView1.GetRaster(), "v:\\images\\babe.cmp", 0,
0, 1);
   //Shape background
   pRasterFXD->ShapeBackgroundStyle = FXD_BACKSTYLE_OPAQUE;
   pRasterFXD->PatternStyle = FXD_PATTERN_CROSS;
   pRasterFXD->PatternBackColor = RGB(255, 0, 0); //red
   pRasterFXD->PatternForeColor = RGB(0, 0, 255); //blue
   //Shape location
   pRasterFXD->ShapeTop = 50.0f;
   pRasterFXD->ShapeLeft = 50.0f;
   pRasterFXD->ShapeWidth = m_LEADRasterView1.GetDstWidth() - 50.0f;
   pRasterFXD->ShapeHeight = m_LEADRasterView1.GetDstHeight() - 50.0f;
   //Make the shape a permanent part of the bitmap
   pRasterFXD->DrawPersistence = TRUE;
   pRasterFXD->DstLeft = 0;
   pRasterFXD->DstTop = 0;
   pRasterFXD->DstRight =
(long)m_LEADRasterView1.GetRaster().GetBitmapWidth();
   pRasterFXD->DstBottom =
(long)m_LEADRasterView1.GetRaster().GetBitmapHeight();
   pRasterFXD->SrcLeft = 0;
   pRasterFXD->SrcTop = 0;
   pRasterFXD->SrcRight =
(long)m_LEADRasterView1.GetRaster().GetBitmapWidth();
   pRasterFXD->SrcBottom =
(long)m_LEADRasterView1.GetRaster().GetBitmapHeight();
   pRasterFXD->ScaleMode = SCALEMODE_PIXEL;
   pRasterFXD->ClientSizeX = 5;
   pRasterFXD->ClientSizeY = 5;
   //Draw the shape

pRasterFXD->DrawShape((ILEADRaster*)m_LEADRasterView1.GetRaster().m_lpDispatch, 0, FXD_SHAPE_RECTANGLE, 0);
   //Repaint
   m_LEADRasterView1.SetAutoRepaint(TRUE);
pRasterFXD->Release();
pRasterIO->Release();