|
-
Oct 7th, 2012, 02:08 PM
#1
Thread Starter
PowerPoster
[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?
-
Oct 7th, 2012, 09:48 PM
#2
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.
-
Oct 8th, 2012, 07:50 AM
#3
Thread Starter
PowerPoster
Re: [VB6] - resize the control with an image
sorry, i can't. because the Usercontrol don't have that property
-
Oct 8th, 2012, 07:54 AM
#4
Re: [VB6] - resize the control with an image
I'm talking about a Picture not UserControl, control.picture=picture.image
-
Oct 8th, 2012, 08:28 AM
#5
Thread Starter
PowerPoster
Re: [VB6] - resize the control with an image
 Originally Posted by 4x2y
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|