BorderImgGetWidth

Syntax

ScaleFactor.d = BorderImgGetWidth(Border, *leftScaleFactor.Double, *topScaleFactor.Double=#Null, *rightScaleFactor.Double=#Null, *bottomScaleFactor.Double=#Null)

Description

Retrieves the scaling factors applied to the non-corner edge slices (top, right, bottom, left) of an image border object when it's rendered. This determines the thickness of these edges relative to their size in the source image. This command is only applicable to borders created with CreateBorderImg().

Parameters

Border
The handle of the image border object.

*leftScaleFactor.Double (optional)
A pointer to a Double variable to receive the scaling factor for the left edge.

*topScaleFactor.Double (optional)
A pointer to a Double variable to receive the scaling factor for the top edge.

*rightScaleFactor.Double (optional)
A pointer to a Double variable to receive the scaling factor for the right edge.

*bottomScaleFactor.Double (optional)
A pointer to a Double variable to receive the scaling factor for the bottom edge.

Return Value

Returns the scaling factor (Double) for the left edge. Returns 0.0 or #False if the border handle is invalid or not an image border. A scale factor of 1.0 means the edge is drawn at its natural thickness (defined by the slices). A factor of 2.0 would double its thickness.

Remarks

These scaling factors affect the perceived thickness of the border's sides.

Example

IncludeFile "ProGUI_PB.pbi"

StartProGUI()

MyImage = CreateImg(50, 50, RGB(200, 200, 200)) ; Placeholder image

If MyImage
  MyBorder = CreateBorderImg(MyImage, 0, 10, 10, 10, 10)
  ; Make the left/right edges twice as thick, top/bottom half as thick
  BorderImgSetWidth(MyBorder, 2.0, 0.5, 2.0, 0.5)

  If MyBorder
    BorderImgGetWidth(MyBorder, @LScale.d, @TScale.d, @RScale.d, @BScale.d)
    Debug "Left Scale Factor: " + StrD(LScale)
    Debug "Top Scale Factor: " + StrD(TScale)
    Debug "Right Scale Factor: " + StrD(RScale)
    Debug "Bottom Scale Factor: " + StrD(BScale)
  
    FreeBorder(MyBorder)
  EndIf
  FreeImg(MyImage)
EndIf

StopProGUI()

See Also

CreateBorderImg, BorderImgSetWidth, BorderImgGetSlices, BorderImgGetFlags

Supported OS

Windows, Linux