Results 1 to 6 of 6

Thread: Full Screen Picture

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2008
    Posts
    22

    Full Screen Picture

    Hi.
    I have a program that runs in a small window, (about a fifth of a full screen) which includes a button, among other objects.
    When the button is clicked I want a full screen picture to be displayed, and when it is clicked again, the picture should close.
    I have tried the Image and Picture controls, but they confine the picture to be within the small window.
    I'm a novice, so this could be a simple question, but I have no idea where to go from here. Any help would be much appreciated.
    Ted.

  2. #2
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Full Screen Picture

    Quote Originally Posted by calpro
    Hi.
    I have a program that runs in a small window, (about a fifth of a full screen) which includes a button, among other objects.
    When the button is clicked I want a full screen picture to be displayed, and when it is clicked again, the picture should close.
    I have tried the Image and Picture controls, but they confine the picture to be within the small window.
    I'm a novice, so this could be a simple question, but I have no idea where to go from here. Any help would be much appreciated.
    Ted.
    Hi, welcome to the forums.

    I'm not sure if you're trying to magnify an already existing picture or just 'open' and 'close' a picture. In the latter case, you can do it in various ways.
    One is using an invisible picturebox. When you click that button, make the picturebox visible and adjust its dimensions as necessary. When you click again you make it invisible. In order to acount for the appropriate action you can use a static variable:

    Code:
    Private Sub Command1_Click()
       Static bVar As Boolean
       'Initial value of bVar is False
    
       If bVar = True Then
          Picture1.Visible = False
       Else
          Picture1.Visible = True
          'Use your values for the left, top, width and height properties
          Picture1.Move xL, xT, xW, xH
          'Plot something in the picturebox if not already there
          '...      
       End If
    
       bVar = Not bVar
    
    End Sub
    Another way to do this is plot on a blank (without controls) form that you can load and unload using code similar to the above.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2008
    Posts
    22

    Re: Full Screen Picture

    Hi krtxmrtz.Thanks for your reply, and sugestion. The end results were:
    1. The picture was displayed, when the button was clicked.
    2. The picture filled the small window, but it did not fill the screen. The picture was contained within the borders of the small form that I'm using.

    What could you suggest I try?
    Thanks again,
    Ted.

  4. #4
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Full Screen Picture

    Quote Originally Posted by calpro
    Hi krtxmrtz.Thanks for your reply, and sugestion. The end results were:
    1. The picture was displayed, when the button was clicked.
    2. The picture filled the small window, but it did not fill the screen. The picture was contained within the borders of the small form that I'm using.

    What could you suggest I try?
    Thanks again,
    Ted.
    Then I would plot to a form. Add a borderless form (border style = None) to your project (e.g. Form2), and place a picturebox of any size (Pic1) on that form.

    Place this code in the main form:
    VB Code:
    1. Private Sub Command1_Click()
    2.    Form2.Show 1   'Load and display the form and make it modal
    3. End Sub

    In Form2 you can place this code:

    VB Code:
    1. Private Sub Form_Load()
    2.    'Make your form as big as the whole screen
    3.    Me.Move 0, 0, 0.5*(Screen.Width - Width), 0.5*(Screen.Height - Height)
    4.    'Make your picturebox as large as the form (i.e. as the screen)
    5.    Pic1.Move 0, 0, Me.Width, Me.Height
    6.    'Here place the code to draw to the picture box
    7.    '...
    8.    '...
    9. End Sub
    10. 'Now, to hide the picture and go back to the main form, click on the picture:
    11. Private Sub Pic1_Click()
    12.    Me.Hide
    13. End Sub
    Let me know how this works, I haven't tried it myuself.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Sep 2008
    Posts
    22

    Re: Full Screen Picture

    Hi.
    I've just a few minutes ago tried it with a form, and it worked perfectly.
    Thanks, you've been a great help. I could have spent a lot of time on this without your help.
    Ted

  6. #6
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Full Screen Picture

    Quote Originally Posted by calpro
    Hi.
    I've just a few minutes ago tried it with a form, and it worked perfectly.
    Thanks, you've been a great help. I could have spent a lot of time on this without your help.
    Ted
    You're welcome, (also to rate the post!) + Mark thread resolved.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

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