Need to add helpers for validating Graphics rendering
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 1.1k
- Avg merge
- 20h 23m
- Merged PRs (30d)
- 103
Description
There are two components to this. The first is relatively easy- we need helpers and some examples to view GDI calls generated when rendering to a `Graphics` object. The second is more complicated- we need to be able to look at GDI+ records.
Recording and playing back GDI records from a Graphics object can be done in a few ways:
1. We can create a Graphics object around a Metafile HDC we create and just look at that HDC the way we're already doing it.
2. We can create a System.Drawing MetaFile around a stream and create a Graphics object from that to record to. You can then grab the HENHMETAFILE from the MetaFile and enumerate the way we already are.
Enumerating the GDI+ records is more complicated as the record headers and parsing need to be created from scratch by following the EMF+ specification.
I've started fiddling with the lower level APIs with this here: https://github.com/JeremyKuhne/WInterop/blob/main/src/Tests/WInterop.Tests/GdiPlus/Metafiles.cs#L65 This code can be used to find the equivalent System.Drawing entry points.
The EMF+ specification:
https://docs.microsoft.com/openspecs/windows_protocols/ms-emfplus/5f92c789-64f2-46b5-9ed4-15a9bb0946c6
Contributor guide
Assessment
This issue has not been assessed yet.