Images for StatusStrip

Ian3 66 Reputation points
2022-06-14T20:49:32.837+00:00

I search Internet and get several images download. Then use the below to add them on StatusStripItems of Powershell Form as below:

$statusstrip1.Items.Add('Text', [System.Drawing.Image]::FromFile('c:\image.png'))

I found the images show poor quality. Is it the issue of image size? If so, what is the right pixel size? Thanks.

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,824 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,358 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Rich Matheisen 44,776 Reputation points
    2022-06-14T21:41:17.34+00:00

    The "images" should be icons, not full-on graphics. So probably one of these dimensions (depending on screen resolution):

    128 x 128 pixels  
    96 x 96 pixels  
    180 x 180 pixels  
    72 x 72 pixels  
    64 x 64 pixels  
    24 x 24 pixels  
    
    0 comments No comments

  2. Limitless Technology 39,341 Reputation points
    2022-06-15T15:31:13.893+00:00

    Hi Ian3-9218,

    The ImageScalingSize property may help with the image quality.

    You may find the following article helpful:

    https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.statusstrip?view=windowsdesktop-6.0

    I hope this answers your question.

    -----------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--