PaintEffectMaxPasses example for C++ Builder
This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.
LEADRasterIO* pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
LEADRasterView1->AutoRepaint = False;
LEADRasterView1->PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN; //Set the Effect
LEADRasterView1->PaintEffectMaxPasses = 5; //5 total passes
LEADRasterView1->PaintEffectPass = 1; //Start with pass number 1
LEADRasterView1->PaintNotificationDelay = 200; //Delay 200 milliseconds between passes
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\240bit.bmp"), 0, 0, 1);//Load the image
LEADRasterView1->AutoRepaint= True;
pRasterIO-> Release( );
void __fastcall TForm1::LEADRasterView1PaintNotification(TObject *Sender,
short uPass, short uType)
{
//If the first pass is complete
if ((uType == EFX_NOTIFY_IMAGE) && (uPass > 0))
{
//Toggle the effect from left_to_right to right_to_left
if (LEADRasterView1->PaintEffect == EFX_EFFECT_WIPE_RECTANGLE_IN)
LEADRasterView1->PaintEffect= EFX_EFFECT_WIPE_RECTANGLE_OUT;
else
LEADRasterView1->PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN;
}
}