-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* (Add) Pixel Editor - Supports and Drain holes: AntiAliasing * (Add) Pixel Editor - Drawing: Line type and defaults to AntiAliasing * (Add) Pixel Editor - Drawing: Line thickness to allow hollow shapes * (Add) Pixel Editor - Drawing: Layer depth, to add pixels at multiple layers at once * (Add) Pixel Editor: Text writing
- Loading branch information
Showing
10 changed files
with
667 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* GNU AFFERO GENERAL PUBLIC LICENSE | ||
* Version 3, 19 November 2007 | ||
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> | ||
* Everyone is permitted to copy and distribute verbatim copies | ||
* of this license document, but changing it is not allowed. | ||
*/ | ||
using System; | ||
using System.Drawing; | ||
using Emgu.CV; | ||
using Emgu.CV.CvEnum; | ||
|
||
namespace UVtools.Core.PixelEditor | ||
{ | ||
public class PixelText : PixelOperation | ||
{ | ||
public FontFace Font { get; } | ||
|
||
public double FontScale { get; } | ||
public ushort Thickness { get; } | ||
public string Text { get; } | ||
public bool Mirror { get; } | ||
|
||
public bool IsAdd { get; } | ||
|
||
public byte Color { get; } | ||
|
||
public Rectangle Rectangle { get; } | ||
|
||
public PixelText(uint layerIndex, Point location, LineType lineType, FontFace font, double fontScale, ushort thickness, string text, bool mirror, bool isAdd) : base(PixelOperationType.Text, layerIndex, location, lineType) | ||
{ | ||
Font = font; | ||
FontScale = fontScale; | ||
Thickness = thickness; | ||
Text = text; | ||
Mirror = mirror; | ||
IsAdd = isAdd; | ||
|
||
Color = (byte) (isAdd ? 255 : 0); | ||
int baseLine = 0; | ||
Size = CvInvoke.GetTextSize(text, font, fontScale, thickness, ref baseLine); | ||
Rectangle = new Rectangle(location, Size); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.