Results 1 to 9 of 9

Thread: how to make a form huge?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    how to make a form huge?

    Hi my form is limmited to the size of my screen. How do I make it bigger?

    If this isn't overridable does anyone have an algorythm to seamlessly put forms together so a drawing or map can continue for a while using a scrollbar to navigate using streight vb and api?

  2. #2
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127
    you dont make the form bigger !

  3. #3
    Zaei
    Guest
    You should probably use a Scroll Window. To create this thing, Add a picture box to your form, and another picture box inside that one. Add two scrollbars, one vertical, and one horizontal. Resize the INNER picture box to the size of your image, and have the scroll bars move that picture box when they scroll.

    Z.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    The form is still limmited in size to the screen dimensions. Picbxs are also limmited in size. I need a way to seamlessly combine windows (regardless of wether they're forms or picboxes or not) to have a continuous scrolling screen. The scroll part I know. The best method of seaming windows or overriding their boundries is what I'm after. You know, just like the original mario bros if anyone's old enough to remember.

  5. #5
    Zaei
    Guest
    I dont really know how to say this without seeming mean, but that is wrong. You dont stitch forms to gether to make a scrolling map, its a waste of resources. Generally, you take a single image, probably the size of the screen, for your background. In this case, we will say this is the sky in SMB. You then figure out at what point in the map that your screen is at. Say it is at 32 pixels from the start. You Blt the sky image starting at 32 pixels, and then again to fill in the first 32 pixels with the last 32 pixels of the same image (wrapping the image). Then you need to find out which objects are visible, be they enemies, pipes, bricks, etc, and blt them in the correct places. Last, you Blt on Mario, and siaply the thing on the screen (either with BitBlt/PaintPicture for double buffering, or .Refresh()). You continue to do this, over and over, usually as fast as the computer can go, adding in movement, and such.

    Z.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    no offence taken,
    BUT I am one to not care about the way things are but one to make things the way they aught to be. I want to draw stuff in a paint program that has only the limmits of my resources from left to right untill my resources are at say 45% then I'll throw a low on memory warning.
    For the issue at hand I want to know if anyone has any ideas on how to seam pictures together so that when I come to the end of a (this should make you happy) Picture box (not form) I can dynamically allocate a new one that seamlessly borders the one to it's left and constantly moves with it as I scroll or move the mouse outside the original borders.

  7. #7
    Zaei
    Guest
    If you wont change your mind... =)

    Method 1
    You will have to set your picturebox(or form)'s border to none, so there is no border (you can figure out how to do that), and then set it on your form to take up the whole form area. Create a second picture box and move it to the right of the first (so you cant see it). Load the first chunk of map into pic1, and the second into pic2. When you scroll, move both pictureboxes. When pic1 goes off the screen, load the third chunk of map into pic1, and mvoe ti to the right of pic2. Repeat for each chunk of map.

    Method 2
    DO the same thing for pic1 as above (borderless), and give it an index property of 0. Use a for loop, and loop through the number of mapchunks that you have:
    Code:
    For i = 0 to numChunk - 1
      Load pic1(i)
      // position
    When a chunk comes on screen as you scroll, make it visible.

    Method 1 is more Windows friendly, and Method 2 is easier.

    Z.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    thanks! I'll see what I come up with

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    How do I make the jump?

    How do I make the jump from one form to the next without re-buttondowning ?

    <vbcode>
    Option Explicit
    Dim oldx As Single, oldy As Single

    Private Sub Form_Initialize()
    Dim i As Integer
    Me.ScaleMode = vbPixels
    Me.Height = 10000
    Me.Width = 12000
    For i = 0 To 4
    Picture1(i).ScaleMode = vbPixels
    Picture1(i).AutoRedraw = True
    Picture1(i).Top = 0
    Picture1(i).Width = 585
    Picture1(i).Height = 401
    Next
    With HScroll1
    .Top = 405
    .Left = 8
    .Width = 601
    .Min = 0: .Max = 2000
    End With
    Picture1(0).Left = Picture1(0).Left - HScroll1.Value
    Picture1(1).Left = Picture1(0).Left + Picture1(1).Width
    Picture1(2).Left = Picture1(1).Left + Picture1(2).Width
    Picture1(3).Left = Picture1(2).Left + Picture1(3).Width
    Picture1(4).Left = Picture1(3).Left + Picture1(4).Width
    End Sub

    Private Sub HScroll1_Change()
    Dim i As Integer
    For i = 0 To 4: Picture1(i).Top = 0: Next
    Picture1(0).Left = Picture1(0).Left - HScroll1.Value
    Picture1(1).Left = Picture1(0).Left + Picture1(1).Width
    Picture1(2).Left = Picture1(1).Left + Picture1(2).Width
    Picture1(3).Left = Picture1(2).Left + Picture1(3).Width
    Picture1(4).Left = Picture1(3).Left + Picture1(4).Width
    End Sub

    Private Sub Picture1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    oldx = X: oldy = Y
    End Sub

    Private Sub Picture1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    DrawWidth = 5
    If Button = 1 Then
    If X > Picture1(Index).Width Then
    Index = Index + 1
    Exit Sub
    End If
    Picture1(Index).Line (oldx, oldy)-(X, Y), vbRed
    oldx = X: oldy = Y
    Picture1(Index).Refresh
    End If
    End Sub

    </vbcode>

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