ImageEn, unit imageenview




function YBmp2Scr(y: Integer; CurrentLayer: Boolean = False): Integer;


The YBmp2Scr and XBmp2Scr methods convert a bitmap coordinate to the window coordinate (considering the Zoom and View status). x and y are bitmap coordinates.
These methods are useful to select a bitmap region independently from the Zoom, ViewX and ViewY properties.

y is a bitmap coordinate.
If CurrentLayer is true, then y is assumed to be a coordinate of the current layer. If false, y is a coordinate of the background layer (layer 0).

- To convert a coordinate of a non-current layer, you can use TImageEnView.Layers[].ConvYBmp2Scr
- The resulting screen value is relative to the control, i.e. assumes the TImageEnView is positioned at 0,0 on the active screen
- If you are using the PdfViewer in ShowAllPages mode, y is assumed to be a position within the active page (See: PageOrigin)


Demo  Demos\Other\PixelView\PixelView.dpr


// Select rect 10, 10, 100, 100 of bitmap
x1 := XBmp2Scr(10);
y1 := YBmp2Scr(10);
x2 := XBmp2Scr(100);
y2 := YBmp2Scr(100);
ImageEnView1.Select( x1, y1, x2, y2);

// Select rect 10,10,100,100 of the window
ImageEnView1.Select(10, 10, 100, 100)

See Also

- XBmp2Scr
- XScr2Bmp
- YScr2Bmp