VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Code shows how to use BitBlt and an offscreen Device Context to scroll a Picture in a PictureBox. T

Jon Mooty AKA YoungBuck  (5 Submissions)   Miscellaneous   Visual Basic 5.0   Unknown Difficulty   Mon 15th January 2001   Mon 8th February 2021

Code shows how to use BitBlt and an offscreen Device Context to scroll a Picture in a PictureBox. This is pretty much the complete source for

API Declarations


'ALL IN A FORM, ALSO HAVE TO ADD THE FOLLOWING CONTROLS AND NAME THEM PROPERLY _
IN ORDER FOR APP TO PERFORM CORRECTLY _
Add a CommandButton and name it cmdBrowse _
Add a PictureBox and name it Picture1 _
Add a HScrollBar and name it HScroll1 _
Add a VScrollBar and name it VScroll1 _
Add a CommonDialog and name it CommonDialog1 (under _
Project/Components/Microsoft Common Dialog Control)
'*********************************************

Option Explicit

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 CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight 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 Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long

Private Const SRCCOPY = &HCC0020

Private lngDC As Long
Private lngOrigBMP As Long



Rate Code shows how to use BitBlt and an offscreen Device Context to scroll a Picture in a PictureBox. T (1(1 Vote))
Code shows how to use BitBlt and an offscreen Device Context to scroll a Picture in a PictureBox. T.bas

Code shows how to use BitBlt and an offscreen Device Context to scroll a Picture in a PictureBox. T Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters