Results 1 to 6 of 6

Thread: [VB6]i need some advices;)

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    [VB6]i need some advices;)

    i have some properties for change the colision rectangule dimensons. these properties are working fine. but the problem is that my UC scalemode can be diferent from parent(a container) scalemode(these scalemode isn't knowed).
    how can i convert the my UC(that's in pixel mode) for the parent scalemode?
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: [VB6]i need some advices;)

    Try using ScaleX & ScaleY. If x is in usercontrol scalemode....
    myLeft = ScaleX(X, Usercontrol.ScaleMode, vbContainerPosition)
    :: vbContainerSize is used when measuring dimensions/sizes
    :: vbContainerPosition is used when converting X,Y coordinates

    Edited: Keep in mind that scalemode can be different for every control. If your uc is in a picbox (uc container) and that picbox is in another picbox that is on the form, both picboxes can have different scalemodes as well as the form.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: [VB6]i need some advices;)

    Quote Originally Posted by LaVolpe View Post
    Try using ScaleX & ScaleY. If x is in usercontrol scalemode....
    myLeft = ScaleX(X, Usercontrol.ScaleMode, vbContainerPosition)
    :: vbContainerSize is used when measuring dimensions/sizes
    :: vbContainerPosition is used when converting X,Y coordinates

    Edited: Keep in mind that scalemode can be different for every control. If your uc is in a picbox (uc container) and that picbox is in another picbox that is on the form, both picboxes can have different scalemodes as well as the form.
    see these code:
    Code:
     L1 = Extender.Left + Col.Left
                    T1 = Extender.Top + Col.Top
                    W1 = Col.width
                    H1 = Col.height
    the Col.... are in pixel(it's our UC).
    Code:
    L2 = ctlTemp.Left + Parent.Controls(i).LimColLeft
                                T2 = ctlTemp.Top + Parent.Controls(i).LimColTop
                                W2 = ctlTemp.LimColWidth
                                H2 = ctlTemp.LimColHeight
    the LimCol..... are another instance in same container(i don't know the scalemode).
    these is why that i ask. the UC is in pixel, but the container can have a diferent scalemode.
    i belive that my math isn't correct, unless the container is in pixel too
    VB6 2D Sprite control

    To live is difficult, but we do it.

  4. #4

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: [VB6]i need some advices;)

    then i belive, like you said, that i need convert the col values(without change them).
    tell me how can i convert pixels to container scalemode. is pixels*screen.twips or pixels\screen.twips?
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

  5. #5
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: [VB6]i need some advices;)

    ScaleX and ScaleY as I suggested in post #2.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  6. #6

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: [VB6]i need some advices;)

    i continue not reciving the right values
    Code:
    If Col.Activate = True Then
      L1 = Extender.Left + ScaleX(Col.Left, UserControl.ScaleMode, vbContainerPosition)
      T1 = Extender.Top + ScaleY(Col.Top, UserControl.ScaleMode, vbContainerPosition)
      W1 = ScaleX(Col.width, UserControl.ScaleMode, vbContainerSize)
      H1 = ScaleY(Col.height, UserControl.ScaleMode, vbContainerSize)
    Else
    Code:
    If ctlTemp.LimColActivate = True Then
       L2 = ctlTemp.Left + ScaleX(ctlTemp.LimColLeft, UserControl.ScaleMode, vbContainerPosition)
       T2 = ctlTemp.Top + ScaleY(ctlTemp.LimColTop, UserControl.ScaleMode, vbContainerPosition)
       W2 = ScaleX(ctlTemp.LimColWidth, UserControl.ScaleMode, vbContainerSize)
       H2 = ScaleY(ctlTemp.LimColHeight, UserControl.ScaleMode, vbContainerSize)
    Else
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

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