Available in the LEADTOOLS Imaging toolkit. |
ReadLoadResolutions Example for C++ 4.0 and later
This example shows how to use the methods and properties for FlashPix files.
CString TempStr, InfoStr; // For composing message strings
int LoadResolutionCount; // Number of resolutions available
// Initialize the display
m_Lead1.SetAutoScroll(FALSE);
m_Lead1.SetAutoSetRects(TRUE);
m_Lead1.SetPaintSizeMode(PAINTSIZEMODE_FIT);
m_Lead1.GetFileInfo("v:\\images\\image5.fpx", 0, 0 );
// Update information about the available resolutions.
m_Lead1.ReadLoadResolutions("v:\\images\\image5.fpx");
// Update a local variable with the number of resolutions.
LoadResolutionCount = m_Lead1.GetLoadResolutionCount();
// Display a message box that shows the available sizes.
InfoStr = "Available dimensions:\n";
for(int i = 0; i < LoadResolutionCount; ++i)
{
TempStr.Format("%d X %d\n", (int)m_Lead1.GetLoadResolutionWidth(i),
(int)m_Lead1.GetLoadResolutionHeight(i) );
InfoStr += TempStr;
}
MessageBox( InfoStr, "File Information" );
// Set the size to load, the smallest size in this case.
m_Lead1.SetLoadResolution(m_Lead1.GetInfoFormat(),
m_Lead1.GetLoadResolutionWidth(0), m_Lead1.GetLoadResolutionHeight(0));
// Get the dimensions that we just set and display them.
m_Lead1.GetLoadResolution(m_Lead1.GetInfoFormat());
InfoStr = "Size that will be loaded:\n\n";
TempStr.Format("%d X %d\n", (int)m_Lead1.GetLoadResolutionWidth(0),
(int)m_Lead1.GetLoadResolutionHeight(0) );
InfoStr += TempStr;
MessageBox(InfoStr, "File Information" );
// Load the bitmap, keeping the bits per pixel of the file.
m_Lead1.Load("v:\\images\\image5.fpx", 0, 0, 1);