Available in the LEADTOOLS Imaging toolkit. |
PaintEffect example for Visual J++
The following modules use the KeyDown and KeyUp events to repaint the image with effects.
private void LEAD1_keyDown(Object source, KeyEvent e)
{
if( e.keyData == 116 ) // Code for F5
{
LEAD1.setAutoRepaint( false );
LEAD1.setBackErase( true );
LEAD1.setEffectGrain( (short) 20 );
LEAD1.setEffectDelay( (short) 50 );
LEAD1.setWandSize( (short) 5 );
LEAD1.setWandColor( new Color( 255,255,0 ) ); // Yellow Wand
LEAD1.setPaintEffect( (short) LTOCXU.EfxPaintEffectConstants.EFX_EFFECT_WIPE_RECTANGLE_INTER_IN_THEN_OUT );
LEAD1.ForceRepaint();
}
}
private void LEAD1_keyUp(Object source, KeyEvent e)
{
if( e.keyData == 116 ) // Code for F5
{
LEAD1.setPaintEffect( (short) LTOCXU.EfxPaintEffectConstants.EFX_EFFECT_WIPE_RECTANGLE_INTER_OUT_THEN_IN );
LEAD1.ForceRepaint();
LEAD1.setPaintEffect( (short) LTOCXU.EfxPaintEffectConstants.EFX_EFFECT_NONE );
}
}