IonicWind Software

IWBasic => General Questions => Topic started by: Brian on December 08, 2021, 09:26:11 AM

Title: Printer Measurements
Post by: Brian on 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
Title: Re: Printer Measurements
Post by: ckoehn on December 10, 2021, 08:08:21 AM
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
Title: Re: Printer Measurements
Post by: Brian on December 10, 2021, 09:40:37 AM
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
Title: Re: Printer Measurements
Post by: ckoehn on December 10, 2021, 10:10:59 AM
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
Title: Re: Printer Measurements
Post by: ckoehn on December 10, 2021, 10:42:15 AM
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
Title: Re: Printer Measurements
Post by: Brian on December 10, 2021, 11:00:50 AM
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
Title: Re: Printer Measurements
Post by: ckoehn on December 10, 2021, 11:24:27 AM
It has to be compiled as a windows program, not a console.  I've never figured out why.
Title: Re: Printer Measurements
Post by: Brian on December 10, 2021, 11:34:47 AM
Well, that fixed it, thank you. Now I need to get the thinking cap on

Brian