Image

From Pointui

Inherits Control.

Displays an image on the screen. The image is typically loaded from a file.

Contents

Properties

Surface (Surface)

The picture that will be displayed at the Image control’s current position.

Methods

void AutoSize()

Sets the Width and Height of the Image control to match the dimensions of the picture as found in the Surface property. This is automatically called during Controls.Add() if the Surface property has been set before then, so often you will call Image.Surface.LoadFromFile() before adding the Image control into the hierarchy using Controls.Add().

void SetAlign(String horizontalAlign, String verticalAlign)

AVAILABLE SINCE: 2.0.28b Sets the horizontal and vertical alignment for the image to be drawn (from the Surface property) within the bounds of the Image control. This requires the Image control bounds to be larger than the image in the Surface property.

PARAMETERS

  • horizontalAlign – must be one of the following String values:
    • “Left”
    • “Center”
    • “Right”
  • verticalAlign – must be one of the following String values:
    • “Top”
    • “Center”
    • “Bottom”

void SetRepeat(String repeat)

AVAILABLE SINCE: 2.0.28f Specifies whether the image should be repeated within the bounds of the Image control if there is sufficient room.

NOTE: The image will start drawing from positioned calculated by applying the alignment settings as specified with SetAlign(). So if you align the image to the center then that is where the image will begin drawing and repeating from.

The repeat paramater must be one of the following values:

  • "None" - no repeat - the image is just drawn once according to the alignment specified with SetAlign()
  • "Horizontal" - continually repeats the image horizontally until the right edge of the Image control is reached - this requires the bounds of the Image control to be larger than the image within it's Surface property
  • "Vertical" - continually repeats the image vertically until the bottom edge of the Image control is reached - this requires the bounds of the Image control to be larger than the image within it's Surface property
  • "Both" - repeats the image both horizontally and vertically until the bottom right corner of the Image control is reached.