Tiling a Bitmap across a forms Background

This sample program show's how to tile a bitmap across a forms background. Any picture can be used - just remember that if you resize the form, you'll need to re-tile the bitmap again.

Screen shot

Download Zipped Project File (3k)



Comments

  • More Dynamic Way

    Posted by Legacy on 11/28/2001 12:00am

    Originally posted by: Andrew Leonard

    Make a new Sub that will perform the same function.
    
    Let's say, ShowBitmap

    Private Sub ShowBitmap

    Dim HorizantalLimit As Integer
    Dim VerticalLimit As Integer
    Dim ii As Integer
    Dim jj As Integer

    HorizantalLimit = Width / Picture1.Width
    VerticalLimit = Height / Picture1.Height

    For ii = 0 To VerticalLimit
    For jj = 0 To HorizantalLimit
    PaintPicture Picture1, jj * Picture1.Width, ii * Picture1.Height, Picture1.Width, Picture1.Height
    Next
    Next

    End Sub

    Call this Sub in Form Load, and also on Form Resize. That way it will automatically load for you, and will resize itself as the dialog is resized.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • With JRebel, developers get to see their code changes immediately, fine-tune their code with incremental changes, debug, explore and deploy their code with ease (both locally and remotely), and ultimately spend more time coding instead of waiting for the dreaded application redeploy to finish. Every time a developer tests a code change it takes minutes to build and deploy the application. JRebel keeps the app server running at all times, so testing is instantaneous and interactive.

  • Live Event Date: May 6, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT While you likely have very good reasons for remaining on WinXP after end of support -- an estimated 20-30% of worldwide devices still are -- the bottom line is your security risk is now significant. In the absence of security patches, attackers will certainly turn their attention to this new opportunity. Join Lumension Vice President Paul Zimski in this one-hour webcast to discuss risk and, more importantly, 5 pragmatic risk mitigation techniques …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds