C#:
public static void DrawBitBlt(Graphics g, Bitmap bmp, ref Rectangle destRec)
{
IntPtr hDC= g.GetHdc();
IntPtr offscreenDC= a.Api.CreateCompatibleDC(hDC);
a.Api.SelectObject(offscreenDC, bmp.GetHbitmap());
if(bmp.Width==destRec.Width && bmp.Height==destRec.Height)
a.Api.BitBlt(hDC, destRec.X, destRec.Y, destRec.Width, destRec.Height, offscreenDC, 0, 0, SrcCopy);
else
a.Api.StretchBlt(hDC, destRec.X, destRec.Y, destRec.Width, destRec.Height, offscreenDC, 0, 0, bmp.Width, bmp.Height, SrcCopy);
a.Api.DeleteDC(offscreenDC);
g.ReleaseHdc(hDC);
}