就是使用API,PLGBLT,专门为旋转图象准备的,他里面需要一个平行四边形作为参数

解决方案 »

  1.   

    API说明:
    Declare Function PlgBlt Lib "gdi32" (ByVal hdcDest As Long, lpPoint As POINTAPI, ByVal hdcSrc As Long, ByVal nXSrc As Long, ByVal nYSrc As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hbmMask As Long, ByVal xMask As Long, ByVal yMask As Long) As Long
    例程:
    'Example Name:BLT's
    Const BI_RGB = 0
    Const DIB_RGB_COLORS = 0 '  color table in RGBs
    Const DIB_PAL_COLORS = 1 '  color table in palette indices
    Const PATCOPY = &HF00021 ' (DWORD) dest = pattern
    Const PATINVERT = &H5A0049       ' (DWORD) dest = pattern XOR dest
    Const PATPAINT = &HFB0A09        ' (DWORD) dest = DPSnoo
    Private Type POINTAPI
            x As Long
            y As Long
    End Type
    Private Type BITMAPINFOHEADER '40 bytes
            biSize As Long
            biWidth As Long
            biHeight As Long
            biPlanes As Integer
            biBitCount As Integer
            biCompression As Long
            biSizeImage As Long
            biXPelsPerMeter As Long
            biYPelsPerMeter As Long
            biClrUsed As Long
            biClrImportant As Long
    End Type
    Private Type BITMAPINFO
            bmiHeader As BITMAPINFOHEADER
    End Type
    Private Type tBITMAP
        Header As BITMAPINFO
        Bytes(0 To 63) As Byte
    End Type
    Private Declare Function CreateDIBPatternBrushPt Lib "gdi32" (lpPackedDIB As Any, ByVal iUsage As Long) As Long
    Private Declare Function PlgBlt Lib "gdi32" (ByVal hdcDest As Long, lpPoint As POINTAPI, ByVal hdcSrc As Long, ByVal nXSrc As Long, ByVal nYSrc As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hbmMask As Long, ByVal xMask As Long, ByVal yMask As Long) As Long
    Private Declare Function PatBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal dwRop As Long) As Long
    Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
    Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
    Private Sub Form_Paint()
        'KPD-Team 2000
        'URL: http://www.allapi.net/
        'E-Mail: [email protected]
        Dim hBrush As Long, tBr As tBITMAP, Cnt As Long, hOld As Long
        Dim Pt(0 To 2) As POINTAPI
        'set the co?rdintes of the parallelogram
        Pt(0).x = 30
        Pt(0).y = 10
        Pt(1).x = 300
        Pt(1).y = 0
        Pt(2).x = 0
        Pt(2).y = 300
        'resize and modify a screenshot
        PlgBlt Me.hdc, Pt(0), GetDC(0), 0, 0, Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY, ByVal 0&, ByVal 0&, ByVal 0&
        'initialize the tBITMAP-structure
        With tBr.Header.bmiHeader
            .biSize = Len(tBr.Header.bmiHeader)
            .biCompression = BI_RGB
            .biHeight = 8
            .biPlanes = 1
            .biWidth = 8
            .biBitCount = 1
        End With
        For Cnt = 0 To 7
            tBr.Bytes(Cnt) = 128
        Next Cnt
        'create a pattern brush
        hBrush = CreateDIBPatternBrushPt(tBr, DIB_RGB_COLORS)
        'select the brush into the form's DC
        hOld = SelectObject(Me.hdc, hBrush)
        'Perform the Pattern Block Transfer
        PatBlt Me.hdc, 0, 0, 30, 30, PATCOPY
        'restore the old brush and delete our pattern brush
        DeleteObject SelectObject(Me.hdc, hOld)
    End Sub
      

  2.   

    用wsImage3.5 http://www.wave12.com/web/home.asp
      

  3.   

    你们好!“电厂生产管理系统”本人刚刚完成,需要的朋友可以与我联系,我用QQ直接发给你,打包后有30M,源码只有2.5M,呵。。我的QQ:450939943