BrushReset

Syntax

Success = BrushReset(Brush)

Description

Resets the transformation properties (position, scale, rotation) and opacity of the specified brush back to their default values.

Parameters

Brush
The handle of the brush whose transformations and opacity are to be reset.

Return Value

Returns #True if the reset was successful, or #False if the brush handle was invalid.

Remarks

This function sets the brush's X/Y position offset to (0,0), scale factors (X and Y) to 1.0, rotation angle to 0.0, and opacity to 1.0. It effectively removes any transformations applied via BrushSetPosition, BrushSetScale, BrushSetRotation, or BrushSetOpacity. The underlying brush content (image or gradient stops) is not affected.

Example

IncludeFile "ProGUI_PB.pbi"

StartProGUI()

MyImage = CreateImg(50, 50, RGB(0, 255, 255)) ; Cyan square
MyBrush = CreateBrushImg(MyImage)

If MyBrush
  ; Apply some transformations
  BrushSetPosition(MyBrush, 10, 20)
  BrushSetScale(MyBrush, 2.0, 0.5)
  BrushSetRotation(MyBrush, 45, 25, 25)
  BrushSetOpacity(MyBrush, 0.7)
    
  Debug "Brush transformed."

  ; Reset the brush
  BrushReset(MyBrush)
  Debug "Brush reset."

  ; Verify (example - opacity should be 1.0, others require checking internal state or drawing)
  ; Note: ProGUI currently lacks BrushGetPosition/Scale/Rotation functions.
  ; Opacity can be checked implicitly if a BrushGetOpacity existed.

  FreeBrush(MyBrush)
EndIf

If MyImage : FreeImg(MyImage) : EndIf

StopProGUI()

See Also

BrushSetPosition, BrushSetScale, BrushSetRotation, BrushSetOpacity

Supported OS

Windows, Linux