Class ImageControlBuilder
- Namespace
- SharpConsoleUI.Builders
- Assembly
- SharpConsoleUI.dll
Fluent builder for creating ImageControl instances.
public sealed class ImageControlBuilder : IControlBuilder<ImageControl>
- Inheritance
-
ImageControlBuilder
- Implements
- Inherited Members
- Extension Methods
Methods
Build()
Builds the ImageControl instance.
public ImageControl Build()
Returns
Fill()
Sets scale mode to Fill (uniform scale, cropping excess).
public ImageControlBuilder Fill()
Returns
Fit()
Sets scale mode to Fit (uniform scale preserving aspect ratio).
public ImageControlBuilder Fit()
Returns
NoScaling()
Sets scale mode to None (original size, no scaling).
public ImageControlBuilder NoScaling()
Returns
StickyBottom()
Makes the control stick to the bottom of the window.
public ImageControlBuilder StickyBottom()
Returns
StickyTop()
Makes the control stick to the top of the window.
public ImageControlBuilder StickyTop()
Returns
Stretch()
Sets scale mode to Stretch (ignores aspect ratio).
public ImageControlBuilder Stretch()
Returns
Visible(bool)
Sets the visibility.
public ImageControlBuilder Visible(bool visible = true)
Parameters
visiblebool
Returns
WithAlignment(HorizontalAlignment)
Sets the horizontal alignment.
public ImageControlBuilder WithAlignment(HorizontalAlignment alignment)
Parameters
alignmentHorizontalAlignment
Returns
WithMargin(int)
Sets uniform margin on all sides.
public ImageControlBuilder WithMargin(int margin)
Parameters
marginint
Returns
WithMargin(int, int, int, int)
Sets the margin.
public ImageControlBuilder WithMargin(int left, int top, int right, int bottom)
Parameters
Returns
WithName(string)
Sets the control name for lookup.
public ImageControlBuilder WithName(string name)
Parameters
namestring
Returns
WithScaleMode(ImageScaleMode)
Sets the image scale mode.
public ImageControlBuilder WithScaleMode(ImageScaleMode scaleMode)
Parameters
scaleModeImageScaleMode
Returns
WithSource(PixelBuffer)
Sets the pixel buffer source to display.
public ImageControlBuilder WithSource(PixelBuffer source)
Parameters
sourcePixelBuffer
Returns
WithStickyPosition(StickyPosition)
Sets the sticky position.
public ImageControlBuilder WithStickyPosition(StickyPosition position)
Parameters
positionStickyPosition
Returns
WithTag(object)
Sets a tag object.
public ImageControlBuilder WithTag(object tag)
Parameters
tagobject
Returns
WithVerticalAlignment(VerticalAlignment)
Sets the vertical alignment.
public ImageControlBuilder WithVerticalAlignment(VerticalAlignment alignment)
Parameters
alignmentVerticalAlignment
Returns
Operators
implicit operator ImageControl(ImageControlBuilder)
Implicit conversion to ImageControl.
public static implicit operator ImageControl(ImageControlBuilder builder)
Parameters
builderImageControlBuilder