Results 1 to 14 of 14

Thread: TwipsPerPixel Change

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    106

    TwipsPerPixel Change

    Is there a way to Change my Computer TwipsPerPixel Now it's
    TwipsPerPixelX,Y = 15
    But i like to change it but i don't now how to do that.
    any one got info please help me it's for testing

    imosha

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: TwipsPerPixel Change

    TwipsPerPixelX/Y are settings related to your resolution, and changes (if possible) would completely change the look of everything (not just in your application).

    What are you actually trying to do?

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: TwipsPerPixel Change

    If you are doing this for testing, try going into Control Panel - Display...

    Go to the Settings Tab and select the Advanced button.

    Change the DPI settings to CUSTOM and then drag that ruler left and right to see what values you can arrive at.

    I'm not sure this changes the TWIPSPERPIXEL, but it does change the PIXELS per INCH that the display processes with.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    106

    Re: TwipsPerPixel Change

    First Thank you
    Hell what can i do

    is there a way to make my program work in 96Dpi
    even if the user Selected defrant DPI
    please say yes and what is the way?

  5. #5
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: TwipsPerPixel Change

    My guess would be that there is an API call to check or change the DPI value - but I've never had any need to do something like this...

    Sorry.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: TwipsPerPixel Change

    Quote Originally Posted by imosha
    is there a way to make my program work in 96Dpi
    even if the user Selected defrant DPI
    The important point is why do you want to?

    If you want your form to look "right" at different resolutions, see the thread about it in the Classic VB FAQ for some tips.

    If you want to print something at a certain DPI, then change what/how you print.

    If it's something different, we'll need to know what it is.

  7. #7
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: TwipsPerPixel Change

    I have to agree with Si - it's important to make your application fit to the layout, size and arrangement of the display properties that a user selects.

    It is not reasonable to change the users settings when your app is run.

    I am disappointed in how my app may look when someone selects "large fonts" - but I would rather see that and attempt to adjust.

    I might not be happy when the first wide-screen but-small-display trys my app and it blows up trying to re-size the form to fit - but I would rather it happens and I can correct it.

    People select odd themes and colors...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: TwipsPerPixel Change

    Quote Originally Posted by szlamany
    People select odd themes and colors...
    God knows that is the truth.
    Quote Originally Posted by szlamany
    I am disappointed in how my app may look when someone selects "large fonts" - but I would rather see that and attempt to adjust.
    I would take this one step further and say that I've been down right disgusted by some of the things people have do to my apps with respect to how they look. However, we are not creating this applications for ourselves. We are creating them for our customer, and if that is what they want, it is our responsibility to see that that is what they get.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    106

    Re: TwipsPerPixel Change

    to fix this problam i need to work a long long long time and im not going to that yet
    with all the respecte to the user
    if i work so hard it's my lost and not the user lost
    any way it's not safe to say that i can fix this error in my program



    Thank you all
    Last edited by imosha; May 15th, 2006 at 08:44 AM.

  10. #10
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: TwipsPerPixel Change

    Quote Originally Posted by imosha
    The probalm is that All my Control Moves Same Are The Same And Same are changed
    Yes but if you move same in the same but other direction while still sizing same on same but other it wouldn't be same but different . Sorry, but did that make any more sense to you than it did to me?

    You can use the GetDeviceCaps API function to determent which DPI setting the current display is using. However you can't obviously have different DPI settings for different application shown by the same graphic card.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    106

    Re: TwipsPerPixel Change

    Quote Originally Posted by Joacim Andersson
    Yes but if you move same in the same but other direction while still sizing same on same but other it wouldn't be same but different . Sorry, but did that make any more sense to you than it did to me?
    lol No

    You can use the GetDeviceCaps API function to determent which DPI setting the current display is using. However you can't obviously have different DPI settings for different application shown by the same graphic card.
    Q. if i have a textBox and i like to Make the Text And the textBox larger in Pixels is there a way to do that ?
    Last edited by imosha; May 15th, 2006 at 11:46 AM.

  12. #12
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: TwipsPerPixel Change

    Yes, change the width and the height properties of the textbox. If you set the ScaleMode property of the Form to vbPixels all controls on it will be messured in pixels instead of in twips.

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    106

    Re: TwipsPerPixel Change

    Quote Originally Posted by Joacim Andersson
    Yes, change the width and the height properties of the textbox. If you set the ScaleMode property of the Form to vbPixels all controls on it will be messured in pixels instead of in twips.
    thank you
    that i didn't need to do i select VBPixels in start


    what i need to say is

    if my screnn Fonts are 10 Pixels Height in normal DPI
    and what is like is that my Fonts will B 10 Pixels Height in NOT normal DPI

    any way i stop working on that
    maybe next week it's will be ease to search for API Call than working like a Dog to Fix Error's

    Thank you all for traying

  14. #14
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: TwipsPerPixel Change

    Just so you know... you can find out the size of text (height or width) in a particular font by using the TextWidth or TextHeight methods of the form, eg:
    VB Code:
    1. Text1.Height = Me.TextHeight("Text to show") + 6
    2. '6 is the (estimated) size of the border, in pixels
    ..note that to do this, the Font of the form needs to be the same as the font of the Textbox.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width