VS 2008 Scaling and layout Setting in W10 is Increasing Image Size-VBForums
Results 1 to 11 of 11

Thread: Scaling and layout Setting in W10 is Increasing Image Size

  1. #1

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,141

    Scaling and layout Setting in W10 is Increasing Image Size

    I dump a snipping tool snip into a picturebox but it is zooming in due the the default increased text size setting in W10.

    If i manually change the setting to 100% users then complain they cannot see icons and text as all are to small.

    How do i handle this issue?
    Last edited by toecutter; Dec 21st, 2017 at 04:58 PM.

  2. #2
    Frenzied Member
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    1,035

    Re: Scaling and layout Setting in W10 is Increasing Image Size

    It might help if you gave a little more explanation about exactly what you are trying to accomplish. You are taking a screen capture of part or all of a user's screen. What are you going to use that for after you display it in a picture box? There may be several possible alternative options, if we knew more about the use of the captured image.

  3. #3

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,141

    Re: Scaling and layout Setting in W10 is Increasing Image Size

    The screen snip is of either a google earth view [eg a roof] or a pdf file [eg floor plan] so it isn't the users screen, it can be what ever size the snipping tool allows and what boundary the user places the rectangle around.

    Currently when its dumped it ends up inserting zoomed by whatever the W10 setting is at which could be 125 - 150 or more percent so it ends up outside of the picture bounds.

    This is only happening in W10.

  4. #4
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    4,316

    Re: Scaling and layout Setting in W10 is Increasing Image Size

    How are you getting the captured image into the picturebox? Could you set the picturbox's SizeMode to "Zoom" so that it auto-scales the image proportionally to fit the picturebox, or do you want to resize the picturebox to fit the image, or something else?

  5. #5

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,141

    Re: Scaling and layout Setting in W10 is Increasing Image Size

    I tried all the different pictuerbox options and i have to have set at normal to work correctly. I also cannot change the perspective of the image as app is construction software so there are issues with changing dimensions of items on the pdf file.

    I believe i have to handle the W10 users different settings some how..


    I just check clipboard contains image and dump.

    Code:
    If Clipboard.ContainsImage = True Then
                Form1.ToolStripMenuItem1.Enabled = True
                Form1._handler.ignoreClick = True
                 Dim img As New Bitmap(Clipboard.GetImage)
                Dim newWidth As Integer = img.Width
                Dim newHeight As Integer = img.Height
                Dim img2 As New Bitmap(img, New Size(newWidth, newHeight))
                Form1._handler.setImage(img2)
    End IF

  6. #6
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,511

    Re: Scaling and layout Setting in W10 is Increasing Image Size

    Do you want to add scroll capability to the PictureBox? If so then add the PictureBox into a Panel container with AutoScroll = True

    Try this

    vb.net Code:
    1. Option Strict On
    2. Option Explicit On
    3.  
    4. Public Class Form1
    5.  
    6.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    7.         Panel1.AutoScroll = True
    8.         PictureBox1.Parent = Panel1
    9.         PictureBox1.Location = New Point(0, 0)
    10.         PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize
    11.     End Sub
    12.  
    13.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    14.         If Clipboard.ContainsImage Then
    15.             PictureBox1.Image = Clipboard.GetImage
    16.         End If
    17.     End Sub
    18.  
    19. End Class



  7. #7

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,141

    Re: Scaling and layout Setting in W10 is Increasing Image Size

    Quote Originally Posted by 4x2y View Post
    Do you want to add scroll capability to the PictureBox? If so then add the PictureBox into a Panel container with AutoScroll = True

    Try this

    vb.net Code:
    1. Option Strict On
    2. Option Explicit On
    3.  
    4. Public Class Form1
    5.  
    6.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    7.         Panel1.AutoScroll = True
    8.         PictureBox1.Parent = Panel1
    9.         PictureBox1.Location = New Point(0, 0)
    10.         PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize
    11.     End Sub
    12.  
    13.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    14.         If Clipboard.ContainsImage Then
    15.             PictureBox1.Image = Clipboard.GetImage
    16.         End If
    17.     End Sub
    18.  
    19. End Class
    Cannot use any of those thx

    I dont have an issue setting the picturebox properties, this is an issue with W10, by default Scale is NOT set at 100% because they use some weird scaling.

    I believe i have to get the users current scale setting and somehow handle the snip as its being dumped into the app.

    This is the setting that is causing my issue..

    Name:  Capture.jpg
Views: 61
Size:  24.0 KB

  8. #8
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,511

    Re: Scaling and layout Setting in W10 is Increasing Image Size

    Sorry, i cannot understand what is the relation between that setting and scaling a PictureBox content? Can you post a screenshot illustrate the problem?



  9. #9
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    4,316

    Re: Scaling and layout Setting in W10 is Increasing Image Size

    You've mentioned Picturebox, and you've mentioned a pdf.
    The zoom mode of a picturebox retains proportion so it shouldn't be distorting the image, but if you don't want to change the image's size, then so be it.

    As for your issue, I guess I can explain what is going on, but I don't know if that will help you decide what you want to do.
    Because people have high density pixel display combined with small screens it is hard to see items at their true scale, so windows scales its drawing up, as the user sees fit.
    For example, the monitor I'm currently using is 1920 pixels wide, and I normally have the laptop driving it so the recommended scaling is 100% since the monitor is large enough that a native 1920 is fine. When I use the laptop directly, then the recommended scaling is 125%. Since my scaling is 100% currently, I'll set it to 125% for this post, make everything draw larger.

    You can see the consequences of this by Maximizing your Form, and then looking at Form.Width. The screen is a true 1920 pixels, but the pixel size that Windows is reporting and drawing makes the form show its width as 1552, instead of 1920.

    If I hit Alt-Printscreen to capture the form while it is maximized I get a copy of the form, but the image captured is 1920 pixels wide since it is capturing the whole width of the screen. It doesn't matter how much I zoom the desktop drawing, 125%, 150%, 200% etc., the items on the screen get larger (just as if I scaled up drawing in my picturebox), so see less of my form, i.e. the maximum size gets smaller in the scaled coordinates, but is still 1920 pixels in the video frame buffer.

    So, if I capture my 1552 pixel wide form which was scaled to fit the 1920 pixel wide screen, resulting in a 1920 pixel wide capture, and then display it in my form, the 1920 pixel image will exceed my form's display 1552 pixel by 25%.

    Bottom line, what issue are you having. The captured image will look larger if you display it in your form, but the image will have the resolution of the area of the screen captured. It won't be the area of the original image displayed on the screen since everything displayed is scaled up.
    If I load a 256 pixel wide image in Paint, it will be 256 pixels wide in memory, but will be drawn 320 pixels wide on the screen. But since everything is scaled, paint will show that it is 256 pixels wide and will report the mouse positions in the scaled drawing coordinates, not the raw video frame buffer coordinates, so the application works as expected, even though things are larger.

    Unfortunately, I suppose, the screen capture is drawing agnostic, so doesn't know your desktop is reporting 1552 pixels wide screen for mouse coordinates and window coordinates, while the physical pixel buffer is actually 1920 pixels wide (or whatever variation of screen size and scaling you have selected).

    So, do you want to scale the screen capture down to keep the display size in your form the same size as it appeared on screen, or just accept that you have less form area to work with, and that images will appear larger in your form than on the screen.
    Last edited by passel; Dec 21st, 2017 at 10:50 PM.

  10. #10

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,141

    Re: Scaling and layout Setting in W10 is Increasing Image Size

    Using my new W10 laptop it doesn't seem to be as extreme as some of my users have been. But you should get the idea.

    On some computers half the plan is zoomed out of the screen bounds.

    original snip taken with setting at 150% - snip appears to be a good size

    Name:  snip.jpg
Views: 55
Size:  41.1 KB



    snip after dumped into picturebox - snip zooms due the setting being at 150% - You can see the bottom dimension on the plan are pushed down off the screen.

    Name:  dumped into picterbox.jpg
Views: 52
Size:  37.6 KB

  11. #11

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,141

    Re: Scaling and layout Setting in W10 is Increasing Image Size

    i found this which is what i am trying to implement

    https://stackoverflow.com/questions/...splay-settings

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width