ADisplayXtra 1.2.1
ADisplayXtra is free both personal and commercial use.
Version 1.2.1 is Director 8.5 compatible.
Version 1.2 do not require adisplay.dll, because whole Xtra was written in
C.
Installation:
- For authoring: put ADisplayXtra.x32 into your Director's Xtras folder
- For distributing: put ADisplayXtra.x32 into your projector's Xtras folder.
Required DLL-s: (Windows contains both)
GDI32.DLL
USER32.DLL
Function list:
- aGetDisplayMode()
Return Value: LinearList
Returns
current display mode in linear list. First
number specifies the screen width, in pixels. Second number specifies the
screen height, in pixels. Third number specifies the color resolution, in
bits per pixel (for example: 4 bits for 16 colors, 8 bits for 256 colors,
or 16 bits for 65536 colors).Fourth
member is the current vertical refresh rate of the display, in cycles per
second (Hz). Windows NT/2000 only !
(On windows9x/Me Xtra returns only width, height and bit) Maybe get 0 or
1. A vertical refresh rate value of 0 or 1 represents the display hardware's
default refresh rate.
cmode=value(aGetDisplayMode())
put cmode -- [1152, 864, 16,75]
width=cmode[1]
height= cmode[2]
depth=cmode[3]
- aGetDisplayModes()
Return Value: linearlist
The aGetDisplayModes() function obtains information about
current display device's graphics modes. Xtra
returns vertical refresh rate information only if display hardware report
"true" information - for example 75, not 0 or 1. Function do not
list 0 or 1.
suppMode = aGetDispalyModes()
put suppMode --["640,480,4", "800,600,4", "640,480,8", "800,600,8", "1024,768,8",
"1152,864,8", "1280,1024,8", "640,480,16", "800,600,16", "1024,768,16",
"1152,864,16", "1280,1024,16", "640,480,24", "800,600,24", "1024,768,24",
"1152,864,24", "1280,1024,24", "640,480,32", "800,600,32", "1024,768,32",
"1152,864,32", "1280,1024,32"]
--Does current display support 1024x768 24 bit?
put suppMode.getOne("1024,768,24")
--15
if suppMode.getOne("1024,768,24")
then -- true if not 0, (getOne found position)
poz=suppMode.getOne("1024,768,24")
modestring= suppMode[poz]
oldsep = the itemdelimiter
the itemdelimiter = ","
width = value(modestring.item[1])
height= value(modestring.item[2])
depth=value(modestring.item[3])
the itemdelimiter = oldsep
aChangeDisplayMode(width,height,depth,0)
end if
- aChangeDisplayMode(Width,
Height, Bit, Flag)
Parameters:
Width: Integer --desired
screen width
Height:
Integer --desired
screen height
bit:
Integer --desired
color resolution, in
bits per pixel e.g.(4,8,16,24,32)
Flag:
Integer
0: The graphics
mode for the current screen will be changed dynamically.
1: The graphics
mode for the current screen will be changed dynamically and the graphics
mode will be updated in the registry. The mode information is stored in
the USER profile.
2: The system tests if the requested
graphics mode could be set.
3:
Prevents the system from repositioning
other windows to keep them visible.
4: This device
will become the primary device.
5: The settings
should be changed, even if the requested settings are the same as the current
settings.
6: The settings will be saved in the
registry, but will not take affect.
Return Value: String
Returns one of the following values:
DISP_CHANGE_SUCCESSFUL |
The settings change was successful. |
DISP_CHANGE_RESTART |
The computer must be restarted in order for the graphics
mode to work. |
DISP_CHANGE_BADFLAGS |
An invalid set of flags was passed in. |
DISP_CHANGE_FAILED |
The display driver failed the specified graphics mode. |
DISP_CHANGE_BADMODE |
The graphics mode is not supported. |
DISP_CHANGE_NOTUPDATED |
Windows NT only: Unable to write settings to the registry. |
You can change current display resolution and depth.
Safe
changing:
result= aChangeDisplayMode(width,height,depth,2) --asking
supported width, height etc. read before
if result = "DISP_CHANGE_SUCCESSFUL
" then
aChangeDisplayMode(width,height,depth,0)
end if
- aChangeDisplayModePlus(Width,
Height, Bit, Freq, Flag)
Parameters:
Width: Integer --desired
screen width
Height:
Integer --desired
screen height
Bit:
Integer --desired
color resolution, in
bits per pixel e.g.(4,8,16,24,32)
Freq:
Integer --desired
display vertical refresh rate (60, 70, 75, 85, 100 etc.)
flag:
Integer
0: The graphics
mode for the current screen will be changed dynamically.
1: The graphics
mode for the current screen will be changed dynamically and the graphics
mode will be updated in the registry. The mode information is stored in
the USER profile.
2: The system tests if the requested
graphics mode could be set.
3:
Prevents the system from repositioning
other windows to keep them visible.
4: This device
will become the primary device.
5: The settings
should be changed, even if the requested settings are the same as the current
settings.
6: The settings will be saved in the
registry, but will not take affect.
Return Value: String
Returns one of the following values:
DISP_CHANGE_SUCCESSFUL |
The settings change was successful. |
DISP_CHANGE_RESTART |
The computer must be restarted in order for the graphics
mode to work. |
DISP_CHANGE_BADFLAGS |
An invalid set of flags was passed in. |
DISP_CHANGE_FAILED |
The display driver failed the specified graphics mode. |
DISP_CHANGE_BADMODE |
The graphics mode is not supported. |
DISP_CHANGE_NOTUPDATED |
Windows NT only: Unable to write settings to the registry. |
You can change current
display resolution, depth and display vertical refresh rate.
- aGetVersion()
Return Value: PropertyList
Returns
current version of Xtra.
put aGetVersion()
[#XtraVersion: "1.2"]
- aCountDisplay()
Return Value: PropertyList
Returns
the display count and virtual screen size.
put aCountDisplay()
[#DisplayCount: 1, #VirtualWidth: 1152, #VirtualHeight: 864]
FAQ
- Director does not recognise that screen depth has changed.
Unfortunately Director 7 & 8 does not recognize the color depth has
changed and if you cahnge depth from 16 bit to 8 bit stage will be black,
or if you change depth 8 bit to 16 or 24 bit Director keeps drawing as if
the monitor is still set to 8 bit and 16 bit picture will be ugly.
Director recognize to the color depth has changed only if you make projector
"In a window" option.
- If I change the display to smaller resolution (from 1024/768 to 800/600)
the bottom part of desktop and stage my be disappear.
First, make so called fast-start
projector or at least stub projector( Movie that plays movies that are
external to the projector. Stub projector is very minimal movie only jump
first movie.) Put screen changing code to stub projector' s prepereMovie
or startMovie handler:
global gInit, gOldRes
on prepareMovie
if gInit <> 1
then
changeRes()
end if
end
on changeRes
--prevent screenchange every movie starting
if you have more dir files and screencahnging code in a shared cast
gInit=1
gOldres=aGetdisplayMode()
aChangeDisplayMode(800,600,16,0)
end
And put the first frame script:
on exitFrame
go to
movie "mymovie"
end
--changing
back to original resolution
global gOldRes
on exitMovie
aChangeDisplayMode(gOldres[1],gOldres[2],gOldres[3],0)
end
Or set the rect property of the stage after the resolution has changed.
on changeRes
gerr = achangeDisplayMode(800,600,16,
0)
if gerr = "DISP_CHANGE_SUCCESSFUL"
then
(the stage).rect
= [0,0,800,600]
end if
end
I provide free support trough my web site' s notice board : freextras.freeweb.hu
or freextras.sw.hu and freextras 's listserv:
Subscribe to freextras@primlista.hu
.
ADisplay Xtra (c) FreeXtras, András Kenéz 2001.
Trademarks XtraBuilder (c)1999 Magic Modules.