VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

How to tile an image on a form.

Vicky (J)  (2 Submissions)   Windows API Call/Explanation   VB 6.0   Unknown Difficulty   Thu 30th December 2004   Mon 8th February 2021

How to tile an image on a form.

API Declarations



We will begin by creating a module (.bas file). In the General Declarations of our new module we will declare the BitBlt API Call, and a constant value to be used with this function.


#If Win32 Then
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
#Else
Declare Function BitBlt Lib "gdi" (ByVal hDestDC As Integer, _
ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, _
ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal xSrc As Integer, _
ByVal ySrc As Integer, ByVal dwRop As Long) As Integer
#End If
Const SRCCOPY = &HCC0020
'--end code block
As you can see here I used conditional compilation to use the proper API call for either the 32 bit or 16 bit environment.

Now we will make the TilePicture procedure that will tile the picture passed to it onto the form. Go ahead and enter the code as you see it below.

Rate How to tile an image on a form. (1(1 Vote))
How to tile an image on a form..bas

How to tile an image on a form. Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters