Results 1 to 6 of 6

Thread: simple pic stuff

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    83

    simple pic stuff

    I need a picture to cover the entire form. It has to resize with the form and I need to be able to put other controls on top of it. I also need to be able to draw circles and lines and things over the picture.

    BTW I dont have the vb.net IDE just wordpad so...

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You probably going to have to use the forms' OnPaint method to draw the image to the form, only because you want to be able to resize it. What you will do is create an image object the same size as the form and paint it to the form with the graphics object of the form. You can also use the graphics object to draw the other stuff you want.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    83
    Could you give me some code

    Thanks

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    83
    Actually forget that.

    I think there is something wrong with putting "/Graphics/screen.jpg" in the following code as it doesnt work like that but does if I just put "screen.jpg" even if the file is in both locations

    Dim bgImage As Image = Image.FromFile("/Graphics/screen.jpg")
    Me.BackgroundImage = bgImage

    So how do I get it to use the pic from the Graphics directory

    Thanks

  5. #5
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Try something like:
    Dim bgImage As Image = Image.FromFile(Application.StartupPath & "Graphics/pic.jpg")
    Me.BackgroundImage = bgImage

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    83
    Thanks thats what I needed. Just needs an extra \ I think as below


    Dim bgImage As Image = Image.FromFile(Application.StartupPath & "\Graphics\screen.jpg")
    Me.BackgroundImage = bgImage


    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width