Setting the Picture property of a form ... 
Author Message
 Setting the Picture property of a form ...

I use the following code to create a background:

    Dim P As StdPicture
    Dim i As Long, j As Long
    Dim W As Long, H As Long
    Dim di As Long
    Dim srcDC As Long
    Dim srcBITMAP As Long

    Set P = LoadPicture("B1.bmp")
    W = ScaleX(P.Width, vbHimetric, vbPixels)
    H = ScaleY(P.Height, vbHimetric, vbPixels)

    srcDC = CreateCompatibleDC(hdc)
    srcBITMAP = SelectObject(srcDC, P)

    For i = 0 To ScaleWidth \ W
      For j = 0 To ScaleHeight \ H
        di = BitBlt(hdc, i * W, j * H, W, H, srcDC, 0, 0, SRCCOPY)

    di = SelectObject(srcDC, srcBITMAP)
    di = DeleteDC(srcDC)

However I want to store the new BITMAP to the picture property of the
form, so as I must not redraw it every time.
Is it possible?


Tue, 22 Jan 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Replacing a pictures properties with another pictures properties

2. Setting OCX Property on MDI Child form causes new form to open

3. Setting the picture property of an image

4. Question regarding setting a Picture property in a Usercontrol

5. Set object's picture property

6. Problem with StatusBar control setting Picture property

7. Setting Picture property to (none)

8. Setting The Picture property in rptImage.

9. Problem setting StatusBar1.Panels().Picture property with VB5

10. Set Image.Picture Stretch property.

11. Setting The Picture property in rptImage.

12. Unexpected Error while setting picture property of Picturebox?


Powered by phpBB® Forum Software