This is one of those things that seems more complex than it is. To get the visible are of the bitmap you can use:
function TfrmMain.VisibleBitmapRect(aImageEnView : TImageEnView) : TRect;
begin
Result.Left := aImageEnView.XScr2Bmp( 0 );
Result.Top := aImageEnView.YScr2Bmp( 0 );
Result.Right := aImageEnView.XScr2Bmp( aImageEnView.ClientWidth );
Result.Bottom := aImageEnView.YScr2Bmp( aImageEnView.ClientHeight );
end;
Another example:
// OUTPUT THE VISIBLE BITMAP IN IEVIEW1 to IEVIEW2
// Get a rect of the bitmap area showing
VisibleBmpRect.Left := ImageEnView1.XScr2Bmp( 0 );
VisibleBmpRect.Top := ImageEnView1.YScr2Bmp( 0 );
VisibleBmpRect.Right := ImageEnView1.XScr2Bmp( ImageEnView1.ClientWidth );
VisibleBmpRect.Bottom := ImageEnView1.YScr2Bmp( ImageEnView1.ClientHeight );
// Draw VisibleBmpRect area of IEView1 bitmap to IEView2 bitmap
IEView2.IEBitmap.Width := IERectangle( VisibleBmpRect ).Width;
IEView2.IEBitmap.Height := IERectangle( VisibleBmpRect ).Height;
IEView1.IEBitmap.DrawToTIEBitmap( IEView2.IEBitmap, 0, 0, IERectangle( VisibleBmpRect ) );
IEView2.Update;
Nigel
Xequte Software
www.xequte.com
nigel@xequte.com