PLTPenColor Example for C++ 5.0 and later
void CDemoView::OnLoadPLT()
{
ILEADRasterIO *m_pRasterIO = NULL;
CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&m_pRasterIO
);
int iPen;
int iWidth;
COLORREF crColor;
for (iPen=0; iPen<8 ; iPen++)
{
iWidth= ceil(iPen/2) + 1;
switch ( iWidth )
{
case 1:
{
crColor= RGB ( 255, 0, 0 );
break;
}
case 2:
{
crColor= RGB ( 0, 255, 0 );
break;
}
case 3:
{
crColor= RGB ( 0, 0, 255 );
break;
}
case 4:
{
crColor= RGB ( 255, 255, 0 );
break;
}
default:
crColor= RGB ( 255, 0, 255 );
}
/* Change Pen width */
m_pRasterIO->PLTPenWidth[iPen]= iWidth;
/* Change Pen color */
m_pRasterIO->PLTPenColor[iPen]= crColor;
}
/* Now load the PLT file */
m_pRasterIO->Load(m_LeadRasterView.GetRaster() ,"c:\\image1.plt", 0, 0, 1 );
m_pRasterIO->Release();
}