ReadLoadResolutions example for C++ Builder
This example shows how to use the methods and properties for FlashPix files.
AnsiString InfoStr; /* For composing message strings */
int i; /* Loop counter */
/* Initialize the display */
Lead1->AutoScroll = False;
Lead1->AutoSetRects = True;
Lead1->PaintSizeMode = smFit;
Lead1->GetFileInfo("v:\\images\\image5.fpx", 0);
/* Update information about the available resolutions. */
Lead1->ReadLoadResolutions("v:\\images\\image5.fpx");
/* Display a message box that shows the available sizes. */
InfoStr = "Available dimensions:\n";
for(i = 0; i<Lead1->LoadResolutionCount; i++)
InfoStr = InfoStr + IntToStr(Lead1->LoadResolutionWidth[i]) + " x " + IntToStr(Lead1->LoadResolutionHeight[i]) + "\n";
Application->MessageBox(InfoStr.c_str(), "File Information", MB_OK);
/* Set the size to load, the largest size in this case. */
Lead1->SetLoadResolution(Lead1->InfoFormat, Lead1->LoadResolutionWidth[Lead1->LoadResolutionCount - 1], Lead1->LoadResolutionHeight[Lead1->LoadResolutionCount - 1]);
/* Get the dimensions that we just set and display them. */
Lead1->GetLoadResolution(Lead1->InfoFormat);
InfoStr = AnsiString("Size that will be loaded:\n\n") + IntToStr(Lead1
>LoadResolutionWidth[0]) + " x " + IntToStr(Lead1
>LoadResolutionHeight[0]) + "\n";
Application->MessageBox(InfoStr.c_str(), "File Information", MB_OK);
/* Load the bitmap, keeping the bits per pixel of the file. */
Lead1->Load("v:\\images\\image5.fpx", 0, 0, 1);