|
-
Apr 6th, 2008, 12:31 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] size a picturebox
Why cant a picturebox become bigger than the screen's size? My picture is bigger than the computer screen is and the picturebox cant show it all. When I make the picturebox the right size by using:
Code:
Picturebox.width = picturebox.picture.width
picturebox.height = picturebox.picture.height
it says that it "Can't create autoredraw image", so I set the autoredraw to false and my game doesnt work properly like that. I cant have the picturebox the wrong size, because when I use picturebox.point, and it does it outside of the picturebox,it doesnt return the right colour which is crucial to the game I am making.
How can I change this?
-
Apr 6th, 2008, 12:36 PM
#2
PowerPoster
Re: size a picturebox
 Originally Posted by Kaimonington
Why cant a picturebox become bigger than the screen's size? My picture is bigger than the computer screen is and the picturebox cant show it all. When I make the picturebox the right size by using:
Code:
Picturebox.width = picturebox.picture.width
picturebox.height = picturebox.picture.height
it says that it "Can't create autoredraw image", so I set the autoredraw to false and my game doesnt work properly like that. I cant have the picturebox the wrong size, because when I use picturebox.point, and it does it outside of the picturebox,it doesnt return the right colour which is crucial to the game I am making.
How can I change this?
in visual basic 6 the picturebox don't scroll the image, but you can put the autosize property to true... if your image is more big than your screen, i don't know how can help you... i hope these information help you
-
Apr 6th, 2008, 12:38 PM
#3
Thread Starter
Hyperactive Member
Re: size a picturebox
oh thanks, that worked, why couldnt I just resize it myself though?
-
Apr 6th, 2008, 12:45 PM
#4
PowerPoster
Re: size a picturebox
 Originally Posted by Kaimonington
oh thanks, that worked, why couldnt I just resize it myself though?
the picturebox has 2 types of size:
-normal size: height and width;
-scale size(or image size): scaleheight and scalewidth.
now don't forget too, theres is a property that is scalemode: depending the scalemode the scale size values change...
-
Apr 6th, 2008, 12:45 PM
#5
Re: size a picturebox
 Originally Posted by Kaimonington
oh thanks, that worked, why couldnt I just resize it myself though?
You could, but you were not aware of the scalemode used in the .Width/.Height properties of a picture object. It is something called vbHimetrics. You need to convert that to your picbox' container's scalemode.
Code:
With Picturebox
.Move .Left, .Top, _
ScaleX(.Picture.Width, vbHimetric, .Container.ScaleMode), _
ScaleY(.Picture.Height, vbHimetric, .Container.ScaleMode)
End With
Resizing a picbox to image size does not take into consideration the size of the picbox borders. So, to properly resize it manually, you also most add border width & height to you calculations too.
Typo: vbHimetrics is not plural - should be vbHimetric & changed above.
Last edited by LaVolpe; Apr 6th, 2008 at 12:50 PM.
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
|