增加背景颜色选项

This commit is contained in:
ww-rm
2025-03-27 10:08:16 +08:00
parent 0e6f47b23c
commit 34b7002faf
2 changed files with 8 additions and 2 deletions

View File

@@ -88,6 +88,12 @@ namespace SpineViewer.Exporter
[Category("[0] "), DisplayName(""), Description("")]
public bool RenderSelectedOnly { get; }
/// <summary>
/// 背景颜色 TODO: 提供颜色编辑
/// </summary>
[Category("[0] "), DisplayName(""), Description("使, #RRGGBBAA")]
public SFML.Graphics.Color BackgroundColor { get; set; } = SFML.Graphics.Color.Transparent;
/// <summary>
/// 检查参数是否合法并规范化参数值, 否则返回用户错误原因
/// </summary>

View File

@@ -81,7 +81,7 @@ namespace SpineViewer.Exporter
{
// tex 必须临时创建, 随用随取, 防止出现跨线程的情况
using var tex = GetRenderTexture();
tex.Clear(SFML.Graphics.Color.Transparent);
tex.Clear(ExportArgs.BackgroundColor);
tex.Draw(spine);
tex.Display();
return new(tex.Texture.CopyToImage());
@@ -94,7 +94,7 @@ namespace SpineViewer.Exporter
{
// tex 必须临时创建, 随用随取, 防止出现跨线程的情况
using var tex = GetRenderTexture();
tex.Clear(SFML.Graphics.Color.Transparent);
tex.Clear(ExportArgs.BackgroundColor);
foreach (var spine in spinesToRender) tex.Draw(spine);
tex.Display();
return new(tex.Texture.CopyToImage());