March 28, 2024, 08:23:15 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Printer Measurements

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

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

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.

Maybe give some more info on what you are doing.  :)

Later,
Clint

Brian

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

This gives you the screen dimensions if I read right.

$INCLUDE "windowssdk.inc"

OpenConsole

UINT dpiX, dpiY

dpiX = 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)

CloseConsole

end

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"

OpenConsole

UINT dpiX, dpiY

dpiX = 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)

CloseConsole

end

Later,
Clint

Brian

Clint,

I'm getting this error when compiling:

Compiling Resources...
No Errors

Compiling...
screen dimensions.iwb

Linking...
IWBasic Linker v1.11 Copyright © 2011 Ionic Wind Software
Unresolved external _window_list
Error: C:\IWBDev3\libs\iwbstd.lib\createdialog.o - Unresolved extern _window_list
Error(s) in linking c:\iwbdev3\projects\calendar\screen dimensions.exe

ckoehn

It has to be compiled as a windows program, not a console.  I've never figured out why.

Brian

Well, that fixed it, thank you. Now I need to get the thinking cap on

Brian