Picture size in dialogs

Started by SewWrite, January 16, 2021, 10:05:13 AM

Previous topic - Next topic

SewWrite

I searched for this but didn't find any specific information... is there an easy way to display a picture in a dialog such that it is not resized and is the exact same size as the original bitmap? I have a dialog with a 94x259 pixel graphic. Using trial and error, I have it close to the correct size but can't seem to get it to be exact and some of the lines in the dialog are therefore blurred. Or at least get the aspect ratio correct so that there is less stuttering in the image? Or alternatively, a way to figure out how many pixels an area of the WinBatch dialog needs to be 1:1 ratio? 

kdmoyers

If I remember correctly, this question is all about getting the image size in dialog units to match the image size in pixels.
If that's true, then maybe the help file article on "Dialog Units" will be helpful?  Not sure.

Key bit from the article:

The WinMetrics function can help you calculate pixels per Dialog unit size.
pixperunit_horz = WinMetrics(-5)
pixperunit_vert = WinMetrics(-6)

The mind is everything; What you think, you become.

td

Converting the bitmap size from pixels to dialog units is the solution.  There are several articles about this in the Tech Database. Here is a link to one:

https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/Dialog~Editor/Dialog~Editor~version~6.X+Bitmap~Resizing~in~Dialog.txt
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade