DrawShape example for C++ 5.0 and later

This example demonstrates most of the three-dimensional shape properties as it draws a rectangle on the current bitmap. For example purposes, both inner and outer bands are turned on. However, normal three-dimensional effects use inner bands or outer bands, but not both.

{
ILEADRasterFXD *m_pltRasFxd=NULL;
CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&m_pltRasFxd);
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

m_LEADRasterView1.SetAutoRepaint(FALSE);
// Load an image for the main control
pRasterIO->Load(m_LEADRasterView1.GetRaster().m_lpDispatch, "..\\..\\..\\..\\images\\image1.cmp", 0, 0, 1);
// Load an image for the background of the shape
pRasterIO->Load(m_LEADRasterView2.GetRaster().m_lpDispatch, "..\\..\\..\\..\\images\\ulay1.bmp", 0, 0, 1);
// Shape background
m_pltRasFxd->PutShapeBackgroundStyle(FXD_BACKSTYLE_TILED_IMAGE);
m_pltRasFxd->PutBackgroundImageTop(0);
m_pltRasFxd->PutBackgroundImageLeft(0);
m_pltRasFxd->PutBackgroundImageWidth(m_LEADRasterView2.GetRaster().GetBitmapWidth());
m_pltRasFxd->PutBackgroundImageHeight(m_LEADRasterView2.GetRaster().GetBitmapHeight());
// Shape location
m_pltRasFxd->PutShapeTop(50);
m_pltRasFxd->PutShapeLeft(50);
m_pltRasFxd->PutShapeWidth(m_LEADRasterView1.GetDstWidth() - 50);
m_pltRasFxd->PutShapeHeight(m_LEADRasterView1.GetDstHeight() - 50);
// Shape border
m_pltRasFxd->PutShapeBorderColor(RGB(255, 0, 0));
m_pltRasFxd->PutShapeBorderStyle(FXD_BORDERSTYLE_SOLID);
m_pltRasFxd->PutShapeBorderThickness(10);
m_pltRasFxd->PutShapeInnerBandHiliteColor(RGB(255, 255, 255));
m_pltRasFxd->PutShapeInnerBandShadowColor(0);
m_pltRasFxd->PutShapeInnerBandStyle(FXD_INNERSTYLE_RAISED);
m_pltRasFxd->PutShapeInnerBandThickness(2);
m_pltRasFxd->PutShapeOuterBandHiliteColor(RGB(0, 255, 0));
m_pltRasFxd->PutShapeOuterBandShadowColor(RGB(128, 128, 128));
m_pltRasFxd->PutShapeOuterBandStyle(FXD_OUTERSTYLE_RAISED);
m_pltRasFxd->PutShapeOuterBandThickness(2);
// Make the shape a permanent part of the bitmap
m_pltRasFxd->PutDrawPersistence(TRUE);
// Draw the shape
m_pltRasFxd->DrawShape((ILEADRaster *)m_LEADRasterView1.GetRaster().m_lpDispatch, NULL, FXD_SHAPE_RECTANGLE, m_LEADRasterView2.GetRaster().GetBitmap());
// Repaint
m_LEADRasterView1.SetAutoRepaint(TRUE);

pRasterIO->Release();
m_pltRasFxd->Release();   
}