SystemDraw utility functions
void SetSurface(Draw& w, const Rect& dest, const RGBA *pixels, Size srcsz, Point poff)
void SetSurface(Draw& w, int x, int y, int cx, int cy, const RGBA *pixels)
This function transfers RGBA pixels from buffer to target Draw. If Draw represents window on the screen, function uses optimized algorithm, otherwise transfer is performed by copying pixels to Image and using DrawImage.
In the first variant, target area is dest, srcsz is the size of source pixels buffer, poff.is offset in source buffer (means, only part of source buffer can be copied).
In the second variant, target area is x,y,cx,cy and the source buffer has to have the same size as target.