Brush

Defined in framework ScanditDataCaptureCore

SDCBrush
@interface SDCBrush : NSObject

Added in version 6.0.0

Brushes define how objects are drawn on screen and allow to change their fill and stroke color as well as the stroke width. They are, for example, used to change the styling of barcode locations, or other objects drawn on top of the video preview. Brushes are immutable. Once created none of the members can be modified.

transparentBrush
@property (class, nonatomic, readonly) SDCBrush *transparentBrush

Added in version 6.1.0

Creates a new brush where both fill and stroke colors are set to fully transparent black. The stroke width is set to zero.

- initWithFillColor: strokeColor: strokeWidth:
- (instancetype)initWithFillColor:(nonnull UIColor *)fillColor strokeColor:(nonnull UIColor *)strokeColor strokeWidth:(CGFloat)strokeWidth

Added in version 6.0.0

Creates a new brush with provided fill, stroke colors and stroke width.

- init
- (instancetype)init

Added in version 6.0.0

Creates a new default brush. Both fill and stroke color are set to fully transparent black. The stroke width is set to zero.

fillColor
@property (nonatomic, nonnull, readonly) UIColor *fillColor

Added in version 6.0.0

The fill color used to draw the object.

strokeColor
@property (nonatomic, nonnull, readonly) UIColor *strokeColor

Added in version 6.0.0

The stroke color used to draw the object.

strokeWidth
@property (nonatomic, readonly) CGFloat strokeWidth

Added in version 6.0.0

The width in device-independent pixels used to render the stroke.

+ brushFromJSONString:
+ (nullable instancetype)brushFromJSONString:(nonnull NSString *)JSONString

Added in version 6.2.0

JSONString
@property (nonatomic, nonnull, readonly) NSString *JSONString

Added in version 6.23.0

- cloneWithFillColor:strokeColor:preserveAlpha:
- (instancetype)cloneWithFillColor:(nonnull UIColor *)fillColor
                       strokeColor:(nonnull UIColor *)strokeColor
                     preserveAlpha:(BOOL)preserveAlpha

Added in version 6.14.0

Returns a brush with the same stroke width, but applies the provided colors and, if the last flag is set to true, keeps the original alpha.