May 25, 2022, 01:42:20 AM

## News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!

## Printer Measurements

Started by Brian, December 08, 2021, 09:26:11 AM

0 Members and 1 Guest are viewing this topic.

#### Brian

##### December 08, 2021, 09:26:11 AM
OK, so my A4 printer has a printable area of 2892 horizontal resolution x 4125 vertical resolution

How can I convert those numbers to match my screen resolution? Is it divide by 96 dpi?

Help!

Brian

#### ckoehn

##### December 10, 2021, 08:08:21 AM #1
I started answering this post several times and kept erasing it.  I guess I don't know why you would need this answer.  How are you going to transfer it from your screen to your printer?  My screen is bigger than what my printer page would be.  You will have to scale it to whatever size you need anyway.

Later,
Clint

#### Brian

##### December 10, 2021, 09:40:37 AM #2
Clint,

I have modified an old program called Jonz Calendar. The PDF shows January 2022 printed in landscape mode. I would like the day box divisions to reach the bottom of an A4 page, rather than be cut off short. Gives more room for my nearest and dearest to scribble in!

I can post the whole program if you want to have a mess with it

Brian

#### ckoehn

##### December 10, 2021, 10:10:59 AM #3
This gives you the screen dimensions if I read right.

`\$INCLUDE "windowssdk.inc"OpenConsoleUINT dpiX, dpiYdpiX = GetDeviceCaps(GetWindowDC(0), HORZSIZE)dpiY = GetDeviceCaps(GetWindowDC(0), VERTSIZE)print " ",dpiX," mm wide, ",dpiY," mm tall\n"print (dpiX/25.4)," in wide, ",(dpiY/25.4)," in tall\n"waituntil inkey\$ = chr\$(27)CloseConsoleend`
Later,
Clint

#### ckoehn

##### December 10, 2021, 10:42:15 AM #4 Last Edit: December 10, 2021, 11:56:06 AM by ckoehn
Try this one.

`\$INCLUDE "windowssdk.inc"OpenConsoleUINT dpiX, dpiYdpiX = GetDeviceCaps(GetWindowDC(0), HORZSIZE)dpiY = GetDeviceCaps(GetWindowDC(0), VERTSIZE)print " ",dpiX," mm wide, ",dpiY," mm tall\n"print (dpiX/25.4)," in wide, ",(dpiY/25.4)," in tall\n"dpiX = GetDeviceCaps(GetWindowDC(0), LOGPIXELSX)dpiY = GetDeviceCaps(GetWindowDC(0), LOGPIXELSY)print " ",dpiX," pixels per inch wide , ",dpiY," pixels per in tall\n"waituntil inkey\$ = chr\$(27)CloseConsoleend`
Later,
Clint

#### Brian

##### December 10, 2021, 11:00:50 AM #5
Clint,

I'm getting this error when compiling:

Compiling Resources...
No Errors

Compiling...
screen dimensions.iwb

Unresolved external _window_list
Error: C:\IWBDev3\libs\iwbstd.lib\createdialog.o - Unresolved extern _window_list