Available in the LEADTOOLS Imaging toolkit. |
BitmapDataPath Example for Visual J++
This example shows how to load an image from the Internet. It uses the BitmapDataPath property to start the asynchronous load; then uses the ReadyStateChange event to paint the image when loading is complete.
private void button1_click(Object source, Event e)
{
// Start the asynchronous load.
LEAD1.setBitmapDataPath( "http://www.leadtools.com/images/vbaward.jpg" );
}
private void LEAD1_readyStateChange(Object source, LTOCXU.LEAD.ReadyStateChangeEvent e)
{
// Paint the image when loading is complete.
if( e.ReadyState == LTOCXU.ReadyStateConstants.READYSTATE_COMPLETE )
{
LEAD1.setAutoSetRects( true );
LEAD1.setPaintSizeMode( (short) LTOCXU.PaintSizeModeConstants.PAINTSIZEMODE_FIT );
LEAD1.ForceRepaint();
}
}