inches of a monitor

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Macric
Coder
Posts: 34
Joined: Fri Mar 25, 2005 11:11 pm
Location: Mexico

inches of a monitor

Post by Macric »

is there a way to know the inches of a monitor?
maybe an interrupt or something?
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

No
I have left this dump.
Seb McClouth

Post 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
DrV
Veteran
Posts: 63
Joined: Thu Jun 02, 2005 9:44 pm

Post 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.
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

But you can get the pixels of your screen... in qb the max is (I think) 640x480 = 307200 pixels.

grtz
Seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
Macric
Coder
Posts: 34
Joined: Fri Mar 25, 2005 11:11 pm
Location: Mexico

Post by Macric »

hey guys and ladies, possibly i did get an answer
http://www.network54.com/Forum/message? ... 1126517805
Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:

Post 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....
Macric
Coder
Posts: 34
Joined: Fri Mar 25, 2005 11:11 pm
Location: Mexico

Post by Macric »

Antoni wrote:...so probably it will not work...
yep, sadly i think you are right.
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post 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
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
Macric
Coder
Posts: 34
Joined: Fri Mar 25, 2005 11:11 pm
Location: Mexico

Post by Macric »

Thank you.
User avatar
Michael Calkins
Veteran
Posts: 76
Joined: Tue Apr 05, 2005 8:40 pm
Location: Floresville, Texas
Contact:

Post 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
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
Post Reply