Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long) As Long Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As LongPrivate Const SRCCOPY = &HCC0020 Private Const SRCAND = &H8800C6 Private Const SRCPAINT = &HEE0086 Private Const SRCINVERT = &H660046 Private Const SRCERASE = &H440328 Private Const NOTSRCERASE = &H1100A6 Private Const NOTSRCCOPY = &H330008 Private Const PATPAINT = &HFB0A09 Private Const PATINVERT = &H5A0049 Private Const PATCOPY = &HF00021 Private Const MERGEPAINT = &HBB0226 Private Const MERGECOPY = &HC000CA Private Const DSTINVERT = &H550009Private Sub cmdDisplay_Click() Dim hdc As Long Dim lReturn As Long Dim hWnd As Long
hWnd = fra.hWnd hdc = GetDC(hWnd) pic.AutoRedraw = True With pic ZoomDraw .hdc, .ScaleWidth, .ScaleHeight, hdc, Val(cboRate.Text) .Refresh End With pic.AutoRedraw = False lReturn = ReleaseDC(hWnd, hdc) End SubPrivate Sub ZoomDraw(ByVal hDestDC As Long, ByVal Width As Long, ByVal Height As Long, hSrcDC As Long, Optional ByVal dblZoom As Double = 1) Dim lReturn As Long lReturn = StretchBlt(hDestDC, 0, 0, Width * dblZoom, Height * dblZoom, hSrcDC, 0, 0, Width, Height, SRCCOPY) End Sub
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long) As Long Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As LongPrivate Const SRCCOPY = &HCC0020 Private Const SRCAND = &H8800C6 Private Const SRCPAINT = &HEE0086 Private Const SRCINVERT = &H660046 Private Const SRCERASE = &H440328 Private Const NOTSRCERASE = &H1100A6 Private Const NOTSRCCOPY = &H330008 Private Const PATPAINT = &HFB0A09 Private Const PATINVERT = &H5A0049 Private Const PATCOPY = &HF00021 Private Const MERGEPAINT = &HBB0226 Private Const MERGECOPY = &HC000CA Private Const DSTINVERT = &H550009Private Sub cmdDisplay_Click() Dim hdc As Long Dim lReturn As Long Dim hWnd As Long
hWnd = fra.hWnd hdc = GetDC(hWnd) pic.AutoRedraw = True With pic ZoomDraw .hdc, .ScaleWidth, .ScaleHeight, hdc, Val(cboRate.Text) .Refresh End With pic.AutoRedraw = False lReturn = ReleaseDC(hWnd, hdc) End SubPrivate Sub ZoomDraw(ByVal hDestDC As Long, ByVal Width As Long, ByVal Height As Long, hSrcDC As Long, Optional ByVal dblZoom As Double = 1) Dim lReturn As Long lReturn = StretchBlt(hDestDC, 0, 0, Width * dblZoom, Height * dblZoom, hSrcDC, 0, 0, Width, Height, SRCCOPY) End Sub
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As LongPrivate Const SRCCOPY = &HCC0020
Private Const SRCAND = &H8800C6
Private Const SRCPAINT = &HEE0086
Private Const SRCINVERT = &H660046
Private Const SRCERASE = &H440328
Private Const NOTSRCERASE = &H1100A6
Private Const NOTSRCCOPY = &H330008
Private Const PATPAINT = &HFB0A09
Private Const PATINVERT = &H5A0049
Private Const PATCOPY = &HF00021
Private Const MERGEPAINT = &HBB0226
Private Const MERGECOPY = &HC000CA
Private Const DSTINVERT = &H550009Private Sub cmdDisplay_Click()
Dim hdc As Long
Dim lReturn As Long
Dim hWnd As Long
hWnd = fra.hWnd
hdc = GetDC(hWnd)
pic.AutoRedraw = True
With pic
ZoomDraw .hdc, .ScaleWidth, .ScaleHeight, hdc, Val(cboRate.Text)
.Refresh
End With
pic.AutoRedraw = False
lReturn = ReleaseDC(hWnd, hdc)
End SubPrivate Sub ZoomDraw(ByVal hDestDC As Long, ByVal Width As Long, ByVal Height As Long, hSrcDC As Long, Optional ByVal dblZoom As Double = 1)
Dim lReturn As Long
lReturn = StretchBlt(hDestDC, 0, 0, Width * dblZoom, Height * dblZoom, hSrcDC, 0, 0, Width, Height, SRCCOPY)
End Sub
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As LongPrivate Const SRCCOPY = &HCC0020
Private Const SRCAND = &H8800C6
Private Const SRCPAINT = &HEE0086
Private Const SRCINVERT = &H660046
Private Const SRCERASE = &H440328
Private Const NOTSRCERASE = &H1100A6
Private Const NOTSRCCOPY = &H330008
Private Const PATPAINT = &HFB0A09
Private Const PATINVERT = &H5A0049
Private Const PATCOPY = &HF00021
Private Const MERGEPAINT = &HBB0226
Private Const MERGECOPY = &HC000CA
Private Const DSTINVERT = &H550009Private Sub cmdDisplay_Click()
Dim hdc As Long
Dim lReturn As Long
Dim hWnd As Long
hWnd = fra.hWnd
hdc = GetDC(hWnd)
pic.AutoRedraw = True
With pic
ZoomDraw .hdc, .ScaleWidth, .ScaleHeight, hdc, Val(cboRate.Text)
.Refresh
End With
pic.AutoRedraw = False
lReturn = ReleaseDC(hWnd, hdc)
End SubPrivate Sub ZoomDraw(ByVal hDestDC As Long, ByVal Width As Long, ByVal Height As Long, hSrcDC As Long, Optional ByVal dblZoom As Double = 1)
Dim lReturn As Long
lReturn = StretchBlt(hDestDC, 0, 0, Width * dblZoom, Height * dblZoom, hSrcDC, 0, 0, Width, Height, SRCCOPY)
End Sub
nik_Amis(Azrael) 昨天给你分,怎么没给上?
窗体大到屏幕外怎么取?有好方法吗?
starlee(独孤一星) 谢谢,你没明白我的意思