Add wxGraphicsContext support to wxSVGFileDC (PR #26395)

10 views
Skip to first unread message

Blake-Madden

unread,
Apr 19, 2026, 4:12:44 PM (5 days ago) Apr 19
to wx-...@googlegroups.com, Subscribed

By calling GetGraphicsContext() on a wxSVGFileDC, you can now access a wxSVGGraphicsContext (derived from wxGraphicsContext) which supports:

  • Cubic and quadratic Bézier curves via wxGraphicsPath
  • Linear and radial gradient brushes
  • Semi-transparent colors and alpha blending
  • Arbitrary affine transformations

Basically, the wxSVGGraphicsContext* writes to its parent wxSVGFileDC's SVG buffer as you issue drawing commands to it.

I added a demonstration to the SVG sample (basic stuff, but shows off the features).

The following images are of my output SVG. I'm able to get some nice effects, such as a sunflower:

image.png (view on web)

Or a Chernoff face:

image.png (view on web)

I believe the full graphics context API is available in here now (at least the parts that are analogous to SVG).


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26395

Commit Summary

  • 71c59c2 Initial support for Graphics Context for wxSVGDCFile
  • 97edd61 Add Begin/EndLayer support to wxSVGFileDC
  • 29f3265 Add gradient & radial pens and brushes to wxSVGGraphicsContext
  • dc99f6e In sample, use paint event handle
  • 61d08b0 Demonstrate new features in the sample
  • 29af5ab Make members static, make helpers private again
  • a27c98d Add API docs
  • a694fcc Fix version numbers
  • 081d479 Implement GetClipBox()
  • 2a461ca Minor doc cleanup

File Changes

(18 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26395@github.com>

Blake-Madden

unread,
Apr 19, 2026, 4:25:28 PM (5 days ago) Apr 19
to wx-...@googlegroups.com, Push

@Blake-Madden pushed 2 commits.

  • 9f2f213 Fix whitespace and file include
  • b1cebec Add pointer check to test case


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26395/before/2a461ca7123e9fa897506ce1255728ef9cd7dca3/after/b1cebecbb4e404a3d51aaa746be609a5c1ac8bb1@github.com>

Blake-Madden

unread,
Apr 19, 2026, 4:31:37 PM (5 days ago) Apr 19
to wx-...@googlegroups.com, Push

@Blake-Madden pushed 1 commit.

  • ac283b7 Fix indentation that was causing GCC warning/error


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26395/before/b1cebecbb4e404a3d51aaa746be609a5c1ac8bb1/after/ac283b74072d8437429028918eb4c7e62f59f70f@github.com>

Reply all
Reply to author
Forward
0 new messages