public void DrawText(IBrush foreground, Point origin, IFormattedTextImpl text) { using (var paint = CreatePaint(foreground, text.Measure())) { var textImpl = (FormattedTextImpl)text; textImpl.Draw(this, Canvas, origin.ToSKPoint(), paint); } }
/// <inheritdoc /> public void DrawText(IBrush foreground, Point origin, IFormattedTextImpl text) { using (var paint = CreatePaint(foreground, text.Bounds.Size)) { var textImpl = (FormattedTextImpl)text; textImpl.Draw(this, Canvas, origin.ToSKPoint(), paint, _canTextUseLcdRendering); } }
public ArcRender(Rect bounds, IFormattedTextImpl textImpl, int stroke_w, float angle1, float angle2, Color strokeColor) : base(bounds, textImpl) { stroke = stroke_w; StrokeColor = strokeColor; _angle1 = angle1; _angle2 = angle2; }
/// <summary> /// Draws text. /// </summary> /// <param name="foreground">The foreground brush.</param> /// <param name="origin">The upper-left corner of the text.</param> /// <param name="text">The text.</param> public void DrawText(IBrush foreground, Point origin, IFormattedTextImpl text) { var layout = ((FormattedTextImpl)text).Layout; _context.MoveTo(origin.X, origin.Y); using (var b = SetBrush(foreground, new Size(0, 0))) { Pango.CairoHelper.ShowLayout(_context, layout); } }
/// <inheritdoc/> public void DrawText(IBrush foreground, Point origin, IFormattedTextImpl text) { var next = NextDrawAs <TextNode>(); if (next == null || !next.Item.Equals(Transform, foreground, origin, text)) { Add(new TextNode(Transform, foreground, origin, text, CreateChildScene(foreground))); } else { ++_drawOperationindex; } }
/// <summary> /// Initializes a new instance of the <see cref="TextNode"/> class. /// </summary> /// <param name="transform">The transform.</param> /// <param name="foreground">The foreground brush.</param> /// <param name="origin">The draw origin.</param> /// <param name="text">The text to draw.</param> /// <param name="childScenes">Child scenes for drawing visual brushes.</param> public TextNode( Matrix transform, IBrush foreground, Point origin, IFormattedTextImpl text, IDictionary <IVisual, Scene> childScenes = null) { Bounds = new Rect(origin, text.Size).TransformToAABB(transform); Transform = transform; Foreground = foreground?.ToImmutable(); Origin = origin; Text = text; ChildScenes = childScenes; }
/// <summary> /// Initializes a new instance of the <see cref="TextNode"/> class. /// </summary> /// <param name="transform">The transform.</param> /// <param name="foreground">The foreground brush.</param> /// <param name="origin">The draw origin.</param> /// <param name="text">The text to draw.</param> /// <param name="childScenes">Child scenes for drawing visual brushes.</param> public TextNode( Matrix transform, IBrush foreground, Point origin, IFormattedTextImpl text, IDictionary <IVisual, Scene> childScenes = null) : base(text.Bounds.Translate(origin), transform, null) { Transform = transform; Foreground = foreground?.ToImmutable(); Origin = origin; Text = text; ChildScenes = childScenes; }
/// <summary> /// Draws text. /// </summary> /// <param name="foreground">The foreground brush.</param> /// <param name="origin">The upper-left corner of the text.</param> /// <param name="text">The text.</param> public void DrawText(IBrush foreground, Point origin, IFormattedTextImpl text) { if (!string.IsNullOrEmpty(text.Text)) { var impl = (FormattedTextImpl)text; using (var brush = CreateBrush(foreground, impl.Bounds.Size)) using (var renderer = new AvaloniaTextRenderer(this, _deviceContext, brush.PlatformBrush)) { if (brush.PlatformBrush != null) { impl.TextLayout.Draw(renderer, (float)origin.X, (float)origin.Y); } } } }
public TestServices With( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func <IKeyboardDevice> keyboardDevice = null, IKeyboardNavigationHandler keyboardNavigation = null, ILayoutManager layoutManager = null, Func <IMouseDevice> mouseDevice = null, IRuntimePlatform platform = null, IPlatformRenderInterface renderInterface = null, IRenderLoop renderLoop = null, IScheduler scheduler = null, ICursorFactory standardCursorFactory = null, IStyler styler = null, Func <Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null, PlatformHotkeyConfiguration platformHotkeyConfiguration = null, IFontManagerImpl fontManagerImpl = null, IFormattedTextImpl formattedTextImpl = null) { return(new TestServices( assetLoader: assetLoader ?? AssetLoader, focusManager: focusManager ?? FocusManager, inputManager: inputManager ?? InputManager, keyboardDevice: keyboardDevice ?? KeyboardDevice, keyboardNavigation: keyboardNavigation ?? KeyboardNavigation, layoutManager: layoutManager ?? LayoutManager, mouseDevice: mouseDevice ?? MouseDevice, platform: platform ?? Platform, renderInterface: renderInterface ?? RenderInterface, scheduler: scheduler ?? Scheduler, standardCursorFactory: standardCursorFactory ?? StandardCursorFactory, styler: styler ?? Styler, theme: theme ?? Theme, threadingInterface: threadingInterface ?? ThreadingInterface, windowingPlatform: windowingPlatform ?? WindowingPlatform, windowImpl: windowImpl ?? WindowImpl, platformHotkeyConfiguration: platformHotkeyConfiguration ?? PlatformHotkeyConfiguration, fontManagerImpl: fontManagerImpl ?? FontManagerImpl, formattedTextImpl: formattedTextImpl ?? FormattedTextImpl)); }
public TestServices( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func <IKeyboardDevice> keyboardDevice = null, IKeyboardNavigationHandler keyboardNavigation = null, ILayoutManager layoutManager = null, Func <IMouseDevice> mouseDevice = null, IRuntimePlatform platform = null, IPlatformRenderInterface renderInterface = null, IRenderLoop renderLoop = null, IScheduler scheduler = null, ICursorFactory standardCursorFactory = null, IStyler styler = null, Func <Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null, PlatformHotkeyConfiguration platformHotkeyConfiguration = null, IFontManagerImpl fontManagerImpl = null, IFormattedTextImpl formattedTextImpl = null) { AssetLoader = assetLoader; FocusManager = focusManager; InputManager = inputManager; KeyboardDevice = keyboardDevice; KeyboardNavigation = keyboardNavigation; LayoutManager = layoutManager; MouseDevice = mouseDevice; Platform = platform; RenderInterface = renderInterface; Scheduler = scheduler; StandardCursorFactory = standardCursorFactory; Styler = styler; Theme = theme; ThreadingInterface = threadingInterface; WindowImpl = windowImpl; WindowingPlatform = windowingPlatform; PlatformHotkeyConfiguration = platformHotkeyConfiguration; FontManagerImpl = fontManagerImpl; FormattedTextImpl = formattedTextImpl; }
public DrawOperationBase(Rect bounds, IFormattedTextImpl noSkia) { Bounds = bounds; NoSkia = noSkia; }
public TriangleWheelRender(Rect bounds, Color hue, IFormattedTextImpl noSkia) : base(bounds, noSkia) { Hue = hue; }
public ColorSquareRender(Rect bounds, IFormattedTextImpl noSkia, Color hueColor, Color strokeColor, int strokeWidth = 10) : base(bounds, noSkia) { HueColor = hueColor; StrokeColor = strokeColor; StrokeWidth = strokeWidth; }
public ColorWheelRender(Rect bounds, IFormattedTextImpl noSkia, float strokeWidth = 20) : base(bounds, noSkia) { StrokeWidth = strokeWidth; }
public void DrawText(IBrush foreground, Point origin, IFormattedTextImpl text) { }
public ColorHSVWheelRender(Rect bounds, IFormattedTextImpl noSKia, float strokeWidth, Color stroke) : base(bounds, noSKia) { Stroke = stroke; StrokeWidth = strokeWidth; }
public BlurImageRender(MemoryStream data, Rect src, Rect dest, float levelX, float levelY, IFormattedTextImpl noSkia) : base(src, noSkia) { _data = data; _levelx = levelX; _levely = levelY; _dest = dest; }