When I make a tile-based map editor in C#, I tend to iterate over the X,Y axes and call Graphics.DrawImage() to blit a single tile in place, from a tileset Bitmap onto a map Bitmap. This process takes several seconds to complete, so I only do it once when loading a new map or changing its tileset. Any edits from there on are relatively fast blits of only the edited tile.
Now, I sat back earlier today and thought about my options. Graphics.DrawImage() is the only one of the three (the others being DrawImageUnscaled and DrawImageUnscaledAndCropped(?)) that allows the specification of a source origin. DrawImageUnscaled() was much, much faster, but always blitted from the top-left of the source bitmap.
In sharp contrast with the speeds of QuickBasic PSET versus POKEing the video memory, or VB6's PSet versus WinAPI's SetPixel, a simple Get/SetPixel loop was as fast as a DrawImageUnscaled call, but did the cropping that only DrawImage would otherwise do.
This is fast enough for now, but I was wondering how something like direct image manipulation could speed it up even more? Something with LockBits perhaps, a function I know next to nothing about?