Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cfb52cc
Migrate WinForms library to .NET 10 and add SkiaSharp painting
dianke09 Mar 11, 2026
8195e47
Expand SkiaSharp migration for panel and WinForms demo controls
dianke09 Mar 11, 2026
5bbc62e
Merge pull request #1 from dianke09/codex/rewrite-control-library-usi…
dianke09 Mar 11, 2026
9baf032
Migrate remaining demo/property rendering paths from GDI+ to Skia
dianke09 Mar 11, 2026
d200c05
Merge branch 'main' into codex/rewrite-control-library-using-skiashar…
dianke09 Mar 11, 2026
860321f
Merge pull request #2 from dianke09/codex/rewrite-control-library-usi…
dianke09 Mar 11, 2026
ec270aa
Migrate core control/treeview paint entry points to SkiaSharp
dianke09 Mar 11, 2026
4fe19d2
Merge branch 'main' into codex/rewrite-control-library-using-skiashar…
dianke09 Mar 11, 2026
6db2e27
Merge pull request #3 from dianke09/codex/rewrite-control-library-usi…
dianke09 Mar 11, 2026
497af97
Continue SkiaSharp migration for STNode, STNodeEditor and STNodePrope…
dianke09 Mar 11, 2026
ae35a6a
Merge branch 'main' into codex/rewrite-control-library-using-skiashar…
dianke09 Mar 11, 2026
2eeb232
Merge pull request #4 from dianke09/codex/rewrite-control-library-usi…
dianke09 Mar 11, 2026
3793651
Move STNodeTreeView to SKControl with direct Skia surface rendering
dianke09 Mar 11, 2026
f9d258d
Merge branch 'main' into codex/rewrite-control-library-using-skiashar…
dianke09 Mar 11, 2026
2ec58d1
Merge pull request #5 from dianke09/codex/rewrite-control-library-usi…
dianke09 Mar 11, 2026
d16579b
Move PropertyGrid and EditorPannel to direct SKControl surface rendering
dianke09 Mar 11, 2026
6832dd4
Merge branch 'main' into codex/rewrite-control-library-using-skiashar…
dianke09 Mar 11, 2026
5f1d78b
Merge pull request #6 from dianke09/codex/rewrite-control-library-usi…
dianke09 Mar 11, 2026
d841eac
Change STNodeEditor base control to SKControl
dianke09 Mar 12, 2026
b2138da
Merge branch 'main' into codex/rewrite-control-library-using-skiashar…
dianke09 Mar 12, 2026
5ea6ed2
Merge pull request #7 from dianke09/codex/rewrite-control-library-usi…
dianke09 Mar 12, 2026
1e6a74e
Advance STNodeEditor repaint path toward SKCanvas rendering
dianke09 Mar 12, 2026
78ae609
Merge branch 'main' into codex/rewrite-control-library-using-skiashar…
dianke09 Mar 12, 2026
1292102
Merge pull request #8 from dianke09/codex/rewrite-control-library-usi…
dianke09 Mar 12, 2026
0e75e94
Refactor STNodeEditor paint entry to SKCanvas renderer
dianke09 Mar 12, 2026
fb25e14
Merge branch 'main' into codex/rewrite-control-library-using-skiashar…
dianke09 Mar 12, 2026
dc3726f
Merge pull request #9 from dianke09/codex/rewrite-control-library-usi…
dianke09 Mar 12, 2026
c92b9fa
Use SKBitmap/SKCanvas in RenderEditorToBitmap
dianke09 Mar 12, 2026
393498c
Merge branch 'main' into codex/rewrite-control-library-using-skiashar…
dianke09 Mar 12, 2026
eaaceb2
Merge pull request #10 from dianke09/codex/rewrite-control-library-us…
dianke09 Mar 12, 2026
8c089a5
Switch STNodeEditor overlay drawing methods to SKCanvas
dianke09 Mar 12, 2026
26881ad
Merge branch 'main' into codex/rewrite-control-library-using-skiashar…
dianke09 Mar 12, 2026
16ff3f2
Merge pull request #11 from dianke09/codex/rewrite-control-library-us…
dianke09 Mar 12, 2026
fb5a284
Fix SkiaDrawingHelper after RenderToGraphics removal
dianke09 Mar 12, 2026
9563099
Merge remote-tracking branch 'origin/main' into codex/rewrite-control…
dianke09 Mar 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions ST.Library.UI/NodeEditor/FrmNodePreviewPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using SkiaSharp;

namespace ST.Library.UI.NodeEditor
{
Expand All @@ -27,8 +28,6 @@ internal class FrmNodePreviewPanel : Form
private STNodeEditor m_editor;
private STNodePropertyGrid m_property;

private Pen m_pen = new Pen(Color.Black);
private SolidBrush m_brush = new SolidBrush(Color.Black);
private static FrmNodePreviewPanel m_last_frm;

[DllImport("user32.dll")]
Expand Down Expand Up @@ -91,11 +90,7 @@ protected override void OnLoad(EventArgs e) {
m_rect_panel.Y = this.Top;
m_region = new Region(new Rectangle(Point.Empty, this.Size));
m_region.Exclude(m_rect_exclude);
using (Graphics g = this.CreateGraphics()) {
IntPtr h = m_region.GetHrgn(g);
FrmNodePreviewPanel.SetWindowRgn(this.Handle, h, false);
m_region.ReleaseHrgn(h);
}
FrmNodePreviewPanel.SetWindowRgn(this.Handle, IntPtr.Zero, false);

this.MouseLeave += Event_MouseLeave;
m_editor.MouseLeave += Event_MouseLeave;
Expand All @@ -122,23 +117,6 @@ void Event_MouseLeave(object sender, EventArgs e) {

protected override void OnPaint(PaintEventArgs e) {
base.OnPaint(e);
Graphics g = e.Graphics;
m_pen.Color = this.AutoBorderColor ? m_node.TitleColor : this.BorderColor;
m_brush.Color = m_pen.Color;
g.DrawRectangle(m_pen, 0, 0, this.Width - 1, this.Height - 1);
g.FillRectangle(m_brush, m_rect_exclude.X - 1, m_rect_exclude.Y - 1, m_rect_exclude.Width + 2, m_rect_exclude.Height + 2);

Rectangle rect = this.RectangleToClient(m_rect_handle);
rect.Y = (m_nHandleSize - 14) / 2;
rect.X += rect.Y + 1;
rect.Width = rect.Height = 14;
m_pen.Width = 2;
g.DrawLine(m_pen, rect.X + 4, rect.Y + 3, rect.X + 10, rect.Y + 3);
g.DrawLine(m_pen, rect.X + 4, rect.Y + 6, rect.X + 10, rect.Y + 6);
g.DrawLine(m_pen, rect.X + 4, rect.Y + 11, rect.X + 10, rect.Y + 11);
g.DrawLine(m_pen, rect.X + 7, rect.Y + 7, rect.X + 7, rect.Y + 10);
m_pen.Width = 1;
g.DrawRectangle(m_pen, rect.X, rect.Y, rect.Width - 1, rect.Height - 1);
}
}
}
35 changes: 1 addition & 34 deletions ST.Library.UI/NodeEditor/FrmSTNodePropertyInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
using System.Windows.Forms;
using System.Drawing;
using ST.Library.UI.NodeEditor;
using SkiaSharp;

namespace ST.Library.UI
{
internal class FrmSTNodePropertyInput : Form
{
private STNodePropertyDescriptor m_descriptor;
private Rectangle m_rect;
private Pen m_pen;
private SolidBrush m_brush;
private TextBox m_tbx;

public FrmSTNodePropertyInput(STNodePropertyDescriptor descriptor) {
Expand All @@ -29,8 +28,6 @@ public FrmSTNodePropertyInput(STNodePropertyDescriptor descriptor) {
this.ShowInTaskbar = false;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.BackColor = descriptor.Control.AutoColor ? descriptor.Node.TitleColor : descriptor.Control.ItemSelectedColor;
m_pen = new Pen(descriptor.Control.ForeColor, 1);
m_brush = new SolidBrush(this.BackColor);
}

protected override void OnLoad(EventArgs e) {
Expand All @@ -57,36 +54,6 @@ protected override void OnLoad(EventArgs e) {

protected override void OnPaint(PaintEventArgs e) {
base.OnPaint(e);
Graphics g = e.Graphics;
m_brush.Color = m_tbx.BackColor;
g.FillRectangle(m_brush, 1, 1, this.Width - 2 - m_rect.Height, this.Height - 2);
m_brush.Color = m_descriptor.Control.ForeColor;
//Enter
g.FillPolygon(m_brush, new Point[]{
new Point(this.Width - 21, this.Height - 2),
new Point(this.Width - 14, this.Height - 2),
new Point(this.Width - 14, this.Height - 8)
});
g.DrawLine(m_pen, this.Width - 14, this.Height - 3, this.Width - 4, this.Height - 3);
g.DrawLine(m_pen, this.Width - 4, this.Height - 3, this.Width - 4, 14);
g.DrawLine(m_pen, this.Width - 8, 13, this.Width - 4, 13);
//----
g.DrawLine(m_pen, this.Width - 19, 11, this.Width - 4, 11);
//E
g.DrawLine(m_pen, this.Width - 19, 3, this.Width - 16, 3);
g.DrawLine(m_pen, this.Width - 19, 6, this.Width - 16, 6);
g.DrawLine(m_pen, this.Width - 19, 9, this.Width - 16, 9);
g.DrawLine(m_pen, this.Width - 19, 3, this.Width - 19, 9);
//S
g.DrawLine(m_pen, this.Width - 13, 3, this.Width - 10, 3);
g.DrawLine(m_pen, this.Width - 13, 6, this.Width - 10, 6);
g.DrawLine(m_pen, this.Width - 13, 9, this.Width - 10, 9);
g.DrawLine(m_pen, this.Width - 13, 3, this.Width - 13, 6);
g.DrawLine(m_pen, this.Width - 10, 6, this.Width - 10, 9);
//C
g.DrawLine(m_pen, this.Width - 7, 3, this.Width - 4, 3);
g.DrawLine(m_pen, this.Width - 7, 9, this.Width - 4, 9);
g.DrawLine(m_pen, this.Width - 7, 3, this.Width - 7, 9);
}

void tbx_KeyDown(object sender, KeyEventArgs e) {
Expand Down
32 changes: 1 addition & 31 deletions ST.Library.UI/NodeEditor/FrmSTNodePropertySelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using System.Windows.Forms;
using System.Drawing;
using SkiaSharp;

namespace ST.Library.UI.NodeEditor
{
Expand All @@ -14,9 +15,6 @@ internal class FrmSTNodePropertySelect : Form
private int m_nItemHeight = 25;

private static Type m_t_bool = typeof(bool);
private Pen m_pen;
private SolidBrush m_brush;
private StringFormat m_sf;
private Color m_clr_item_1 = Color.FromArgb(10, 0, 0, 0);// Color.FromArgb(255, 40, 40, 40);
private Color m_clr_item_2 = Color.FromArgb(10, 255, 255, 255);// Color.FromArgb(255, 50, 50, 50);
private object m_item_hover;
Expand All @@ -33,11 +31,6 @@ public FrmSTNodePropertySelect(STNodePropertyDescriptor descriptor) {
this.ShowInTaskbar = false;
this.BackColor = descriptor.Control.BackColor;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
m_pen = new Pen(descriptor.Control.AutoColor ? descriptor.Node.TitleColor : descriptor.Control.ItemSelectedColor, 1);
m_brush = new SolidBrush(this.BackColor);
m_sf = new StringFormat();
m_sf.LineAlignment = StringAlignment.Center;
m_sf.FormatFlags = StringFormatFlags.NoWrap;
}

private List<object> m_lst_item = new List<object>();
Expand Down Expand Up @@ -65,29 +58,6 @@ protected override void OnLoad(EventArgs e) {

protected override void OnPaint(PaintEventArgs e) {
base.OnPaint(e);
Graphics g = e.Graphics;
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
Rectangle rect_back = new Rectangle(0, 0, this.Width, m_nItemHeight);
Rectangle rect_font = new Rectangle(10, 0, this.Width - 13, m_nItemHeight);
int nIndex = 0;
string strVal = m_descriptor.GetStringFromValue();
foreach (var v in m_lst_item) {
m_brush.Color = nIndex++ % 2 == 0 ? m_clr_item_1 : m_clr_item_2;
g.FillRectangle(m_brush, rect_back);
if (v == m_item_hover) {
m_brush.Color = m_descriptor.Control.ItemHoverColor;
g.FillRectangle(m_brush, rect_back);
}
if (v.ToString() == strVal) {
m_brush.Color = m_descriptor.Control.ItemSelectedColor;
g.FillRectangle(m_brush, 4, rect_back.Top + 10, 5, 5);
}
m_brush.Color = m_descriptor.Control.ForeColor;
g.DrawString(v.ToString(), m_descriptor.Control.Font, m_brush, rect_font, m_sf);
rect_back.Y += m_nItemHeight;
rect_font.Y += m_nItemHeight;
}
g.DrawRectangle(m_pen, 0, 0, this.Width - 1, this.Height - 1);
}

protected override void OnMouseMove(MouseEventArgs e) {
Expand Down
Loading