Re: Splash Screen and Image Control Problem
- From: "dm4714" <spam@xxxxxxxx>
- Date: Fri, 29 Apr 2005 09:30:48 -0500
Here is some addition information about the bitmap which I'm using an image
control over my form with the dimensions I gave you in previous post:
Image height = 331
Image width = 434
Horizontal DPI = 71
Vertical DPI = 71
"dm4714" <spam@xxxxxxxx> wrote in message
news:uOoKPYMTFHA.2128@xxxxxxxxxxxxxxxxxxxxxxx
> Hi -- I know I'm a bit dense and I understand what you did... I just don't
> understand how I fix this in my situation.
>
> I just tried running the program on both a 96DPI and 120DPI screen. Here
> is what the Height/Width properties are:
>
> DPI96 (small fonts):
> Height =4965
> Width = 6510
> ScaleHeight = 4965
> ScaleWidth = 6510
>
> DPI120 (large fonts):
> Height = 4968
> Width = 6504
> ScaleHeight = 4968
> ScaleWidth = 6504
>
> Now, I tried using your code, and I'm not sure what or where to use the
> results. I would think I have to somehow adjust the frmSplash properties
> to new width/height values or perhaps the scaling. I'm not sure if I need
> to replace with new values or add to what I already have.
>
> Any help or further explanation would be greatly appreciated.
>
>
>
>
> "Randy Birch" <rgb_removethis@xxxxxxxx> wrote in message
> news:Onls1cHTFHA.2096@xxxxxxxxxxxxxxxxxxxxxxx
>> The dell machine is using large fonts; you're using small fonts. A twip
>> is a
>> twip and has nothing to do with resolution. If the image you load is,
>> say,
>> 300x400 pixels, then it will be 300x400 pixels regarless as to the screen
>> size, resolution or font size. What will change is the size of the pixel,
>> so
>> 300 pixels looks "smaller" on a 96 DPI screen than on a 120 DPI screen.
>> But
>> the measurement itself does not change.
>>
>> That said, you do have to account for the fact a form hard-coded to a
>> specific size, stretching an image control to it's client area, may cause
>> the image to stretch or appear off-centre (depending on the settings on
>> the
>> image control). That is what you have to account for, and you can
>> determine
>> the DPI prior to loading your form by a simple api call:
>> http://vbnet.mvps.org/code/screen/screenfont.htm. If the result is 96 use
>> your normal values. If the result is <> 96, then divide the result by 96
>> to
>> get the "scaling factor", and multiply the width and height by that
>> factor
>> to get the required area.
>>
>>
>> Private Sub Command1_Click()
>>
>> Dim dpi As Long
>> Dim factor As Single
>>
>> Dim defWidth As Long
>> Dim defHeight As Long
>>
>> defWidth = 300
>> defHeight = 400
>>
>> 'dpi = <result of API call>
>> dpi = 96 'assume it returns 96
>> factor = dpi / 96
>>
>> Debug.Print factor, defWidth * factor, defHeight * factor
>>
>>
>> dpi = 120 'assume it returns 120
>> factor = dpi / 96
>>
>> Debug.Print factor, defWidth * factor, defHeight * factor
>>
>> End Sub
>>
>> output:
>>
>> 1 300 400
>> 1.25 375 500
>>
>>
>> --
>>
>> Randy Birch
>> MS MVP Visual Basic
>> http://vbnet.mvps.org/
>> ----------------------------------------------------------------------------
>> Read. Decide. Sign the petition to Microsoft.
>> http://classicvb.org/petition/
>> ----------------------------------------------------------------------------
>>
>>
>>
>> "dm4714" <spam@xxxxxxxx> wrote in message
>> news:uCHlvIHTFHA.3308@xxxxxxxxxxxxxxxxxxxxxxx
>> :I have a VB6 form that starts up in middle of screen. The scale mode is
>> "1
>> : twip" and the scale height is 4965 and scale width is 6510. The height
>> of
>> : the form is 4965 and the width is 6510.
>> :
>> : I also have an image control overlaying the entire form. It's height is
>> 4965
>> : and width is 6510.
>> :
>> : The image displays fine on my PC and any PC that is using a 96 DPI size
>> : font.
>> :
>> : On some laptops with wide screens, it would appear that Dell sets the
>> font
>> : to 120 DPI.
>> :
>> : The problem is, my form is not larger than my image, and looks very
>> tacky
>> : when it appears. Again, on a normal desktop with a 96 DPI font, the
>> form
>> : and image are exactly the same size.
>> :
>> : How do I adjust my form with/height to account for the difference in
>> DPI
>> : without having to adjust or stretch my image?
>> :
>> : Any sample code or explanations would be appreciated.
>> :
>> :
>> :
>>
>
>
.
- References:
- Splash Screen and Image Control Problem
- From: dm4714
- Re: Splash Screen and Image Control Problem
- From: Randy Birch
- Re: Splash Screen and Image Control Problem
- From: dm4714
- Splash Screen and Image Control Problem
- Prev by Date: Re: Splash Screen and Image Control Problem
- Next by Date: Re: Splash Screen and Image Control Problem
- Previous by thread: Re: Splash Screen and Image Control Problem
- Next by thread: MsgBox question
- Index(es):
Relevant Pages
|