Problems displaying a large tiled map in WPF

What is the best way to manage a very large number of images (10,000+) in WPF? This is for a 2d tile map editor similar to this: http://www.mapeditor.org/ .

At the moment I have a canvas with all the tiles as an image and a list box that contains various images to choose from. Each fragment is added to the canvas as children, and then saved in the list for later access. You draw on the canvas by setting the Source property for the tile to the one selected in the list. It works well with 50x50 cards, but something higher, which causes loading delays, is generally a slow application.

Any suggestions on this? Could QT be more appropriate instead of wpf?

Thanks in advance

+5
source share
1 answer

Check out the implementation of the virtualized dashboard .

Virtualized panels are effective because:

  • In memory (and visualization), only the displayed elements are displayed (and a few additional borders to ensure smooth scrolling).

  • Elements are reused, not re-created and discarded - the old cell is simply filled with new content (comes with a new DataContext) and used in a new place.

You can also try using WPF DataGrid for this, it supports virtualization out of the box, and essentially you're trying to do it.

WPF, , , ( JavaScript, , , WPF).

+6

All Articles