There are a number of ways, but the simplest may be to use the SetWorldTransform API call with bitblt API call.
An example program is in this post (click here)
Drag the mouse around on the black or white picturebox.
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.