ReadLoadResolutions Example for Visual J++

This example shows how to use the methods and properties for FlashPix files.

// Initialize the display
LEAD1.setAutoScroll( false );
LEAD1.setAutoSetRects( true );
LEAD1.setPaintSizeMode( (short) LTOCXU.PaintSizeModeConstants.PAINTSIZEMODE_FIT );
LEAD1.GetFileInfo( "v:\\images\\image5.fpx", (short) 0, 0 );

// Update information about the available resolutions.
LEAD1.ReadLoadResolutions( "v:\\images\\image5.fpx" );

// Display a message box that shows the available sizes.
String strInfo = "Available dimensions:\n";

for( int i = 0 ; i < LEAD1.GetLoadResolutionCount() ; i++ )
   strInfo += LEAD1.getLoadResolutionWidth( (short) i ) + " X " + LEAD1.getLoadResolutionWidth( (short) i ) + "\n";

MessageBox.show( strInfo );

// Set the size to load, the smallest size in this case.
LEAD1.SetLoadResolution( LEAD1.getInfoFormat(), LEAD1.getLoadResolutionWidth( (short) 0 ), LEAD1.getLoadResolutionHeight( (short) 0 ) );

// Get the dimensions that we just set and display them.
LEAD1.GetLoadResolution( LEAD1.getInfoFormat() );

strInfo = "Size that will be loaded:\n\n";
strInfo += LEAD1.getLoadResolutionWidth( (short) 0 ) + " X " + LEAD1.getLoadResolutionWidth( (short) 0 );
MessageBox.show( strInfo );

// Load the bitmap, keeping the bits per pixel of the file.
LEAD1.Load( "v:\\images\\image5.fpx", (short) 0, (short) 0, (short) 1 );