PCDRes example for C++ Builder

This example checks for a high-resolution image and loads it if possible.

   AnsiString Msg;
   AnsiString myfile;
   LEADRasterIO* pRasterIO= NULL;

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

   myfile= "v:\\images\\pcd\\_aiwanit.pcd"; //No PCD sample image is included with LEADTOOLS
   pRasterIO->GetFileInfo (LEADRasterView1->Raster, AnsiToOLESTR(myfile.c_str()), 0, 0 ) ;
   if (pRasterIO->get_InfoPCDRes (PCDRES_4BASE))
   {
       pRasterIO->PCDRes = PCDRES_4BASE;
       Msg= "Loading 1024 x 1536 resolution";
   }
   else
   {
      pRasterIO->PCDRes= PCDRES_BASE;
       Msg= "Loading 512 x 768 resolution";
   }

   ShowMessage(Msg);
   Cursor= crHourGlass;
   //Turn on the automatic display rectangles and the scroll bars->
   LEADRasterView1->AutoSetRects = True;
   LEADRasterView1->AutoScroll = True;
   //Load the file->
   pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR(myfile.c_str()), 0, 0, 1);
   LEADRasterView1->ForceRepaint ();
   pRasterIO-> Release( );
   Cursor= crDefault;