LoadUseViewPerspective example for C++ Builder
Note: |
This topic is for Document/Medical editions only. |
This example times the loading of a bitmap with and without changing the internal view perspective.
void __fastcall TForm1::TestBtnClick(TObject *Sender)
{
/* Declare local variables */
TDateTime StartTime, DeltaTime;
Word Hour, Min, Sec, MSec;
/* Do not include paints when measuring time. */
Lead1->AutoRepaint = False;
/* Time the load using the bitmap"s view perspective. */
Lead1->LoadUseViewPerspective= True;
StartTime = Now();
Lead1->Load ("d:\\lead\\images\\rotated.tif", 0, 0, 1);
DeltaTime = Now() - StartTime;
DecodeTime(DeltaTime, Hour, Min, Sec, MSec);
ShowMessage("As is, rotated: " + IntToStr(Sec) + " seconds + " +IntToStr(MSec) + " milliseconds");
/* Time the load that converts the bitmap"s view perspective. */
Lead1->LoadUseViewPerspective = False;
StartTime = Now();
Lead1->Load ("d:\\lead\\images\\rotated.tif", 0, 0, 1);
DeltaTime = Now() - StartTime;
DecodeTime(DeltaTime, Hour, Min, Sec, MSec);
ShowMessage("Converted to top left: " + IntToStr(Sec) + " seconds + " +IntToStr(MSec) + " milliseconds");
}