by S.Balamanikandan (1 Submission)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 12th April 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Different ways of copying an image.
API Declarations
Dim op1, op2, op3, op4, op5, op6, op7, op8, op9, op10, op11, op12 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 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 Long
'res = BitBlt&(dect.hDC, 0, 0, 125, 125, src.hDC, sx, sy, op)
res = BitBlt&(d1.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op1)
End Sub
Private Sub Command10_Click()
res = BitBlt&(d6.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op6)
End Sub
Private Sub Command11_Click()
res = BitBlt&(d5.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op5)
End Sub
Private Sub Command12_Click()
res = BitBlt&(d8.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op8)
End Sub
Private Sub Command2_Click()
res = BitBlt&(d2.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op2)
End Sub
Private Sub Command3_Click()
res = BitBlt&(d3.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op3)
End Sub
Private Sub Command4_Click()
res = BitBlt&(d4.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op4)
End Sub
Private Sub Command5_Click()
res = BitBlt&(d12.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op12)
End Sub
Private Sub Command6_Click()
res = BitBlt&(d11.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op11)
End Sub
Private Sub Command7_Click()
res = BitBlt&(d10.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op10)
End Sub
Private Sub Command8_Click()
res = BitBlt&(d9.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op9)
End Sub
Private Sub Command9_Click()
res = BitBlt&(d7.hdc, 0, 0, 115, 115, src.hdc, sx, sy, op7)
End Sub
Private Sub Form_Load()
op1 = &HCC0020
op2 = &HEE0086
op3 = &H8800C6
op4 = &H440346
op5 = &H330008
op6 = &H1100A6
op7 = &HC000CA
op8 = &HBB0226
op9 = &HF00021
op10 = &HFB0A09
op11 = &H5A0049
op12 = &H550009
op13 = &H420049
op14 = &HFF0062
sx = 10
sy = 10
End Sub
Private Sub ST_Click()
res = StretchBlt(STR.hdc, 0, 0, 112, 112, src.hdc, 0, 0, 101, 93, op1)
End Sub