Video thumbnail not the correct size in PictureBox on 4K monitor.

MPIon

Well-known member
Joined
Jun 13, 2020
Messages
75
Location
England
Programming Experience
10+
I have a PictureBox showing the thumbnail of a video using the following code :
C#:
boxData[boxNo].pictureBox.BackgroundImage = shellFile.Thumbnail.LargeBitmap;
boxData[boxNo].pictureBox.Image = Properties.Resources.Sprockets;
This shows correctly on a Full HD monitor at 100% scaling.
When I transfer to 4K monitor it is not correct (27" 4k at 200% scaling).
The Large Thumbnail is
Screenshot 2025-04-15 182346.png


On 4K is shows as :
Screenshot 2025-04-15 182448.png

When changing to ExtraLargeBitmap it shows as :
Screenshot 2025-04-15 182401.png


Neither is correct, but the Extra Large is better.
The sprockets around the image are from a resource file in the application.

Is there a way to adjust the thumbnail to fit?
I have tried Zoom and Stretch on the SizeMode, but they have no effect.

I won't change the monitor scaling from 200% as I need that for other reasons.
 
Did you read the documentation regarding how to use WinForms with High DPI?

 
Thanks for the link Skydiver.
No I have not read this. I suppose I will have to wade through it to see if anything is relevant to thumbnails.
Actually, it is only the background image that seems to have a problem. If I remove this and just set the image to the thumbnail, it is the correct size.
Unfortunately it means that the sprockets that I was using to emphasise that the image is a video are not there.
I might have to find another way to do this if the documentation does not reveal anything.
 
You could make a custom control where there are two owner drawn panels docked to the left and right, and a picture box filling the middle. Draw the sprockets in the panels.
 
Back
Top Bottom