English 中文(简体)
wxGraphicsContext dreadfully slow on Windows
原标题:

I ve implemented a plotter using wxGraphicsContext. The development was done using wxGTK, and the graphics was very fast.

Then I switched to Windows (XP) using wxWidgets 2.9.0. And the same code is extremely slow. It takes about 350 ms to render a frame. Since the user is able to drag the plotter with the mouse to navigate it feels very sluggish with such a slow update rate.

I ve tried to implement some parts using wxDC and benchmarked the difference. With wxDC the code runs just about 100 times faster.

As far as I know both Cairo and GDI+ are implemented in software at this point, so there s no real reason Cairo should be so much faster than GDI+.

Am I doing something wrong? Or is the GDI+ implementation just not up on par with Cairo?

One small note: I m rendering to a wxBitmap now, with the wxGraphicsContext created from a wxMemoryDC. This is to avoid flicker on XP, since double buffering doesn t work there.

问题回答

Excerpt from the cairo homepage:

Cairo is designed to produce consistent output on all output media while taking advantage of display hardware acceleration when available (eg. through the X Render Extension).





相关问题
Gdi Guidance required

I am currently working in C# with wpf, I don t know about graphics, I want to learn about GDI and graphics from scratch, Can anyone help me by providing some basic knowledge or material? Can anyone ...

C# GDI Invert Graphics flipped on the X axis

I am drawing a series of Points using the Graphics class. I am reading from a Point array. For whatever reason the rendered image is upside down (flipped on the X axis). Is there a simple way to tell ...

Win32 DrawText line height

I m calling the Win32 DrawText function to output some text into a device context. The text is long and wraps nicely onto a second line. The problem is I need to decrease the space between lines a ...

wxGraphicsContext dreadfully slow on Windows

I ve implemented a plotter using wxGraphicsContext. The development was done using wxGTK, and the graphics was very fast. Then I switched to Windows (XP) using wxWidgets 2.9.0. And the same code is ...

Remove alpha from a BitmapSource

I use BitBlt() and CreateBitmapSourceFromHBitmap() to capture a window as a BitmapSource that I can display on an Image element in a WPF application. But for some reason, most of the application that ...

WPF Image won t display BitmapSource

I m new to using WPF and GDI, and I m having trouble displaying an image. My eventual goal is to build something expose-like. So far, I gray-out the screens, gather all the active HWNDs, and capture ...

Convert from 32-BPP to 8-BPP Indexed (C#)

I need to take a full color JPG Image and remap it s colors to a Indexed palette. The palette will consist of specific colors populated from a database. I need to map each color of the image to it s "...

热门标签