[API]
BitBlt

[INCLUDE]
DC_Create

[CODE]
Public Function DC_FromDCArea(ByVal hDC As Long, ByRef ClipRect As RECT) As Long
  Dim Width As Long
  Dim Height As Long
  
  Width = ClipRect.Right - ClipRect.Left + 1&
  Height = ClipRect.Bottom - ClipRect.Top + 1&
  DC_FromDCArea = DC_Create(Width, Height)
  If Not DC_FromDCArea = 0& Then
    If BitBlt(DC_FromDCArea, 0&, 0&, Width, Height, hDC, ClipRect.Left, ClipRect.Top, vbSrcCopy) = 0& Then
      Call DC_Delete(DC_FromDCArea)
      DC_FromDCArea = 0&
      End If
    End If
  End Function
