I spent most of today moving Abiathar's rendering system from GDI+ to WPF. Mostly that involved changing uses of Bitmap to BitmapSource and uses of Graphics to DrawingContext, with appropriate adjustments to method calls. I changed the three main viewer panels to element hosts with a Rectangle inside to be the WPF display. Event handlers had to be manually wired up, and the event objects changed somewhat. There are still a few commented-out parts that are noncritical but really hard to migrate, but I did get it to build and run.
Currently, it's a mess. The image is always stretched to fill the whole viewport without scrolling, but I'm sure that can be corrected by nesting the Rectangle inside some other element. More importantly, it's super slow, at least 10x slower than previously, almost certainly even slower than Abiathar v1.0. This can probably be fixed too, but it's clear that WPF isn't as straightforward as I was hoping.
No comments:
Post a Comment