PC SOFT

WINDEV的在线文档

  • Overview
  • Displaying an image file in an Image control
  • In a window
  • Retrieving the name of the image file displayed in the Image control
  • In a window
  • Retrieving the position of the mouse in a clickable image
  • Clearing or reinitializing the content of an Image control
  • Properties specific to the Image controls
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Handling an Image control by programming

Overview
WinDev, WebDev and WinDev Mobile allow you to handle an Image control by programming. To do so, use the variable of the Image control in the code.

The variable of the Image control corresponds to the name of the Image control. This variable is a text variable.

Displaying an image file in an Image control
WinDevWindows Store apps

In a window

To display an image file in an Image control, a simple assignment is sufficient.

Some examples:

  • direct assignment:
IMG_MyImage"C:\Temp\MyImage.gif"

  • assignment by variable:
ImagePath文件当前目录()+"\MyImage.gif"
IMG_MyImageImagePath
Note: An Image control can also be initialized from a buffer variable or from a text variable containing the value of the image in binary.

Note: if the control is associated with a data file item, the assignment is automatically performed by using 数据库表填充到屏幕. See Linking an Image control to an item for more details.

Retrieving the name of the image file displayed in the Image control
WinDevWindows Store apps

In a window

To retrieve the name of the image displayed in an Image control:

  • a simple assignment is sufficient. For example:
EDT_CurrentImageContentIMG_Image1

NameImageFile文件提取路径IMG_Image1文件.名称+文件.扩充

  • use ..值Note: To retrieve the image (or its name) in the item associated with the Image control:
  1. If the control is associated with a text item, the value entered is automatically retrieved by 屏幕填充到数据库表. You can also use the following notation: CUSTOMER.NAME = EDT_Edit1.
  2. If the control is associated with a binary memo, use H关联大对象 to associate the image file with the item.
  3. If the Image control was assigned from a buffer variable or from a string variable, ..值 returns an empty string.
    See Linking an Image control to an item for more details.

Retrieving the position of the mouse in a clickable image
WinDev To retrieve the position of the mouse in a click area, the following functions must be used in the click code of the image:
鼠标水平位置Returns the horizontal coordinate of the mouse click.
鼠标垂直位置Returns the vertical coordinate of the mouse click.

Clearing or reinitializing the content of an Image control
To clear or reinitialize an Image control, all you have to do is assign an empty string to the Image control. For example:

IMG_MyImage""

Note: You also have the ability to use 绘图开始/绘图结束 on the Image control.

Properties specific to the Image controls
WinDevWindows Store apps The following properties are used to manage the characteristics of an Image control by programming.
动画Enables you to find out the current status of the animated image or to stop the animation of an animated image (animated GIF image for example)
初始动画Used to find out the initial status of the animation in an Image control
水平对齐Enables you to find out and modify the horizontal alignment of the image caption
垂直对齐Enables you to find out and modify the vertical alignment of the image caption
图片模式Used to find out and modify the display mode of an image in an Image control.

To find out the entire list of WLanguage properties that can be used with an Image control, see Properties associated with an Image control.
另见