Page 1 of 1

inches of a monitor

Posted: Sun Sep 11, 2005 8:19 am
by Macric
is there a way to know the inches of a monitor?
maybe an interrupt or something?

Posted: Sun Sep 11, 2005 12:45 pm
by Z!re
No

Posted: Sun Sep 11, 2005 1:00 pm
by Seb McClouth
Correction:

Interrupt: no
other way: yes, by measuring by hand... not through programming...
Although there might be away to calculate the diagonal inch.. if you know the others...

grtz
Seb

Posted: Sun Sep 11, 2005 2:44 pm
by DrV
You'd have to ask the user for information like that - there is no standard way for the monitor to report its (physical) size.

Posted: Sun Sep 11, 2005 5:44 pm
by SebMcClouth
But you can get the pixels of your screen... in qb the max is (I think) 640x480 = 307200 pixels.

grtz
Seb

Posted: Tue Sep 13, 2005 5:08 am
by Macric
hey guys and ladies, possibly i did get an answer
http://www.network54.com/Forum/message? ... 1126517805

Posted: Wed Sep 14, 2005 11:28 am
by Antoni
According to Ralf Brown list, that Int 10h function 15h is implemented only for a thing called "PC Convertible" ,so probably it will not work. Go guess....

Posted: Thu Sep 15, 2005 4:09 am
by Macric
Antoni wrote:...so probably it will not work...
yep, sadly i think you are right.

Posted: Thu Sep 15, 2005 10:54 am
by SebMcClouth
Although wait... try this:

Code: Select all

RegsX.AX = &H1130
	RegsX.BX = &H0
	InterruptX &H10, RegsX, RegsX
	VideoLines = (RegsX.DX AND 255) + 1

	RegsX.AX = &HF00
	InterruptX &H10, RegsX, RegsX
	VideoCols = (RegsX.AX AND 65280) / 256

PRINT VideoLines / pixelsperinch; " "; VideoCols / pixelsperinch
You have to keep in mind that you can have a max of 640x480. And you have calculate the pixelsperinch yourselfs.

grtz

Posted: Fri Sep 16, 2005 4:34 am
by Macric
Thank you.

Posted: Fri Sep 16, 2005 11:08 pm
by Michael Calkins
From the book:
Advanced MS-DOS Programming
The Microsoft(R) Guide for Assembly Language and C Programmers
By Ray Duncan
????????????????????????????????????????????????????????????????????????????
Int 10H [EGA] [MCGA] [VGA]
Function 11H (17) Subfunction 30H (48)
Get font information
????????????????????????????????????????????????????????????????????????????

Returns a pointer to the character definition table for a font and the
points (bytes per character) and rows for that font.

Call with:

AH = 11H
AL = 30H
BH = font code
00H = current Int 1FH contents
01H = current Int 43H contents
02H = ROM 8-by-14 font (EGA, VGA only)
03H = ROM 8-by-8 font (characters 00H?7FH)
04H = ROM 8-by-8 font (characters 80H?FFH)
05H = ROM alternate 9-by-14 font (EGA, VGA only)
06H = ROM 8-by-16 font (MCGA, VGA only)
07H = ROM alternate 9-by-16 font (VGA only)

Returns:

CX = points (bytes per character)
DL = rows (character rows on screen - 1)
ES:BP = segment:offset of font table

????????????????????????????????????????????????????????????????????????????
Int 10H [MDA] [CGA] [PCjr] [EGA] [MCGA] [VGA]
Function 0FH (15)
Get video mode
????????????????????????????????????????????????????????????????????????????

Obtains the current display mode of the active video controller.

Call with:

AH = 0FH

Returns:

AH = number of character columns on screen
AL = display mode (see Int 10H Function 00H)
BH = active display page

Note:

? This function can be called to obtain the screen width before clearing
the screen with Int 10H Functions 06H or 07H.
Therefore, all those functions tell you is what your current <b>text</b> dimensions are, for example, 80 x 25. Besides, pixels/inch is kinda what he wants to find automatically.
It is impossible using proper MS-DOS or IBM PC methods. Just prompt the user.
Regards,
Michael