Results 1 to 5 of 5

Thread: [RESOLVED] [VB6] - resize the control with an image

  1. #1
    PowerPoster joaquim's Avatar
    Join Date
    Apr 07
    Posts
    2,494

    Resolved [RESOLVED] [VB6] - resize the control with an image

    ok. you have a control. you show the image using DC's. normaly you do control.picture=picture.image(for save the image on control).
    but the control is more small(or big) than an image. is there any way to catch the image size from control itself?
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2
    Frenzied Member
    Join Date
    Sep 06
    Posts
    1,235

    Re: [VB6] - resize the control with an image

    You can set the picture's property AutoSize to True before loading the image, save its width and height then set AutoSize to False and restore its original width and height.

  3. #3
    PowerPoster joaquim's Avatar
    Join Date
    Apr 07
    Posts
    2,494

    Re: [VB6] - resize the control with an image

    sorry, i can't. because the Usercontrol don't have that property
    VB6 2D Sprite control

    To live is difficult, but we do it.

  4. #4
    Frenzied Member
    Join Date
    Sep 06
    Posts
    1,235

    Re: [VB6] - resize the control with an image

    I'm talking about a Picture not UserControl, control.picture=picture.image

  5. #5
    PowerPoster joaquim's Avatar
    Join Date
    Apr 07
    Posts
    2,494

    Re: [VB6] - resize the control with an image

    Quote Originally Posted by 4x2y View Post
    I'm talking about a Picture not UserControl, control.picture=picture.image
    but i found what i need.
    grp it's my class variable and have the right size... then i did:
    Code:
    UserControl.Width = (GRP.Width + IFF(BorderStyle = BorderFixed, 4, 0)) * Screen.TwipsPerPixelX
            UserControl.Height = (GRP.Height + IFF(BorderStyle = BorderFixed, 4, 0)) * Screen.TwipsPerPixelY
    why plus 4? it's for the border square
    and, i belive, we can use image.width(or it's picture?).
    with that bolean variable(that you sugest) it's working
    thanks for all
    Last edited by joaquim; Oct 8th, 2012 at 08:31 AM.
    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
  •