PatternStyle (ILEADRasterFXD) example for C++ Builder
LEADRasterFXD* pRasterFxd= NULL;
LEADRasterIO* pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&pRasterFxd);
LEADRasterView1->AutoRepaint = False;
//Load an image for the main control
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\Image1.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;
pRasterFxd->ShapeLeft = 50;
pRasterFxd->ShapeWidth = LEADRasterView1->DstWidth - 50;
pRasterFxd->ShapeHeight = LEADRasterView1->DstHeight - 50;
//Make the shape a permanent part of the bitmap
pRasterFxd->DrawPersistence = True;
pRasterFxd->DstLeft = 0;
pRasterFxd->DstTop = 0;
pRasterFxd->DstRight = LEADRasterView1->Raster->BitmapWidth;
pRasterFxd->DstBottom = LEADRasterView1->Raster->BitmapHeight;
pRasterFxd->SrcLeft = 0;
pRasterFxd->SrcTop = 0;
pRasterFxd->SrcRight = LEADRasterView1->Raster->BitmapWidth;
pRasterFxd->SrcBottom = LEADRasterView1->Raster->BitmapHeight;
pRasterFxd->ScaleMode = 3;
pRasterFxd->ClientSizeX = 5;
pRasterFxd->ClientSizeY = 5;
//Draw the shape
pRasterFxd->DrawShape (LEADRasterView1->Raster, 0, FXD_SHAPE_RECTANGLE, 0);
//Repaint
LEADRasterView1->AutoRepaint = True;
pRasterFxd-> Release( );
pRasterIO-> Release( );