ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The DisplayedSection property is used to identify and change the portion of the image displayed in an Image control.
This property is mainly used to zoom in an image while displaying only a section of it. This property must be used in an Image control that allows zooming.
Example
// Save displayed section
rectSave is Rectangle
rectSave = IMG_Photo.DisplayedSection
// Restore displayed section
IMG_Photo.DisplayedSection = rectSave
 
// Zoom X2 on top right
rectX2 is Rectangle
rectX2.X = 1000
rectX2.Y = 0
rectX2.Width = 500
rectX2.Height = 500
IMG_Photo.DisplayedSection = rectX2
 
rectX2.DisplayedSection = O
Syntax

Getting the image section displayed in an Image control Hide the details

<Result> = <Image control>.DisplayedSection
<Result>: Rectangle variable
Rectangle variable that corresponds to the image section displayed.
If the Image control does not contain an image (or contains a generated image (drawing functions)), the rectangle returned will correspond to the control.
<Image control>: Control name
Name of the Image control to be used.

Changing the image section displayed in an Image control Hide the details

<Image control>.DisplayedSection = <New section displayed>
<Image control>: Control name
Name of the Image control to be used.
<New section displayed>: Rectangle variable
  • Name of the Rectangle variable that corresponds to the image section to display.
  • 0 to display the entire image in the Image control.
Remarks
  • The rectangle is expressed in pixels of the image.
  • If the image has multiple DPIs, the rectangle corresponds to 1x zoom.
  • When changing the image section displayed (syntax 2):
    • Zoom is calculated according to the size of the specified rectangle.
    • If the rectangle does not have the same x/y ratio as the Image control, the largest ratio is used.
    • If the rectangle is empty, the action has no effect.
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/06/2022

Send a report | Local help