Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image Stretching problem

Status
Not open for further replies.

MelissaEvans

Programmer
Mar 8, 2001
39
US
I have an image control on a form that I need to be able to move. There are some command buttons that alter the height, width, and so forth with code like
Code:
image1.height = image1.heigh + 60
I have a picture inside the image control, and the stretch property is set to true. I want the picture to take up the whole size of the image control when it is altered.
For now, when the image height/width is altere, the control disappears altogether from the form. When it is returned to its original value, it reappears. This happens when the image is a bitmap or a jpeg. I've tried this on another computer, and it works, but I don't see what the difference is (there's far too many possibilities since I don't know what to look for). It worked on the computer running VB6SP3, not on VB6SP4 which was updated to VB6SP5 and still didn't work.

I tried a different mode of attack and switched to a picture box control. Since there is no Stretch property, I had found and used the code
Code:
ThisControl.PaintPicture ThisControl.Picture, 0, 0, ThisControl.ScaleWidth, ThisControl.ScaleHeight
when the height/width property changed. The picture didn't disappear, which was good, but it didn't stretch either. *sigh*

Has anyone else had this situation? Any suggestions?
~Melissa
 
are you sure...this line is correct in your code?
image1.height = image1.heigh + 60
i guess you mis-spelled it.



 
Try the Refresh method

Like this

Img.Width = Img.Width + 100
Img.Refresh

Jn88
 
I had mis-spelt "height"... the code really has it right. =)

I tried the refresh, and it still does the wierdness.

I was using the image control as a work around for another problem, but I found a different work around that actually works. =) Thanks for your help, I think I'll happily forget this oddity. =)

~Melissa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top