Solved

Image control inconsistent size

Posted on 2000-05-11
3
156 Views
Last Modified: 2010-05-02
I've got a form of set size/fixed borders. I have a number of bitmaps on the form in image controls. They all look hunky dory on my screen, but sometimes when the app is run elsewhere, the graphics are all shorter and narrower than they appear on my screen, which throws things off center and makes me look bad. :-(

I'm assuming this is a screen resolution issue. But I can't mandate the user's screen resolution. So I need to find another way around this.

The image controls each have the .Stretch set to false. Would resetting this to true do it? (I know. I could try it and see. But I don't have consistent access to any of the computers that I've seen it not work on, so I have to fix it without being able to verify that the fix works.)

Any input would be greatly appreciated. Thanks! -- b.r.t.
0
Comment
Question by:BarryTice
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
Ashron earned 50 total points
ID: 2801789
Hi BarryTice.
The answer is yes, setting the Stretch property of the Image control will resize it to the size of the image you load in it, but it won't resize the size of it's container ( frame, form, so on). Unfortunatly, this control doesn't provide the Resize Event. You can easyly figure a way to work around. For example, you could define the SetImage Function, who would load the image into the Control, and then resize its container. Another way you could do it is to use the PictureBox control, which provides the Resize Event. You would code the same in both procedure, but the last has the advantage of updating the size of it's container even if you access the control directly.

The code in the resize event would look like something like this :

private sub pic_Resize()
  ' The pic is in a form
  me.move me.left, me.top, pic.width + 200, pic.height + 200
end sub

Here I use the Move so there is only one Resize Message sent to the From. The 200 value is a random value out of my imagination. You'll have to test it to fit your need.

Hope this help

0
 
LVL 7

Author Comment

by:BarryTice
ID: 2801983
Ashron --

Thanks for the response, but I'm not sure what the resize event would have to do with this. I'm not attempting to resize the graphic, only to not have it appear smaller on some screens.

The graphics in the images are set at design time. They are never changed at run time. Therefore, resize doesn't come into play, that I understand.

Please clarify this, if you would be so kind.

-- b.r.t.


 
0
 
LVL 7

Author Comment

by:BarryTice
ID: 2810710
Well, I'm still not sure what you had intended with the resize events. But setting .Stretch to True did the trick, so I guess that's the answer. (I got access to one of the computers it has blown up on in the past to check it. Unfortunately, that requires kicking the coworker off long enough to do it, which meant she couldn't get any work done while I was testing. :-( )

So, for the long and short of it, I guess you gave me more information than I needed, and I can't fault you for that. Here's your "A" and your first 200 points.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question