test1
March 28, 2017, 09:03:56 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can attach photos hosted by the forum rather than using an external image hosting site, this means they will stay forever and not disappear after a year or two.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Pesho's magic screen dimension script  (Read 3312 times)
Drewid
Administrator
Hero Member
*****
Posts: 2281


wielder of electric crayons


View Profile
« on: November 06, 2011, 02:26:13 PM »

Small update:

I sent a message to NJYTouch if their DVI controllers will allow centered timings, but their answer was that even they're not sure... So i gave up on using any screen resolution shennanigans and made a little AutoHotkey script that will automatically resize/reposition the active window to the specified dimensions and add a black border around it like this:



- To use the script, you need to have Autohotkey installed and run the .AHK file. After that, to "center" a window, just press Ctrl+NumpadEnter.
- To exit (clear the border) press Ctrl+NumpadEnter again.
- To change the dimensions or hotkey, just edit the script with notepad, its currently set for 846x634.
- Alternatively, if you don't want to bother installing autohotkey, there is a compiled EXE file included in the .zip file which you can run.

Download the script



« Last Edit: January 25, 2012, 04:24:55 PM by bernard » Logged

Games work site:  Drewnorthcott.co.uk
Personal site: Bongofish.co.uk
DonShole
Sr. Member
****
Posts: 169



View Profile WWW
« Reply #1 on: November 06, 2011, 03:15:30 PM »

This is must have if your panel is larger than your tablet!
Logged

EZ CINTIQ. How to build a DIY Cintiq, it's  easier than a DIY PC! www.tabletmod.com
Pesho
Sr. Member
****
Posts: 253



View Profile
« Reply #2 on: November 06, 2011, 03:31:15 PM »

I'm glad that i can finally contribute with something after all the useful stuff i've found on this website  Smiley
Logged
DonShole
Sr. Member
****
Posts: 169



View Profile WWW
« Reply #3 on: January 24, 2012, 02:16:37 PM »

Hi Pesho,

I have modified the script for combining an Intuos 4 Medium and TabletMod Large:

Download the script as modified for use with I4M and TabletMod Large V3 here http://tabletmod.com/Downloads/TModLargeforI4M.ahk

To use the I4 Medium with the TabletMod Large Kit,  you will need a sheet of card 2-3mm thick to place between the tablet and the foil shield - this ensures the tablet is close to the LCD Panel.  You will then need a foam board spacer (2 stacks of 5mm thick approximately 40cm long and 3.5cm wide).  Use this to position the tablet inside the enclosure ensuring the active area is behind the screen.  You can measure and use further spacers in the same way to fix the tablet in place.

Note this script presumes your TabletMod Large is also the primary display. 
To fine tune the position of the active window, you will need to edit these two lines:

WinSet, Region, 0-0 1439-0 1439-899 0-899 0-0 1-130 980-130 980-755 1-755 1-130, TheBlack
WinSet, Transparent, 0, ahk_class Shell_TrayWnd

The values 0-0 1439-0 1439-899 0-899 0-0 define the outer border of the black boundary - a closed loop of x-y coordinates.  The values 1-130 980-130 980-755 1-755 1-130 define the inner boundary of the border giving the dimensions 979x625 noted above.

@ Pesho, how do you turn a script into an exe file ?
Logged

EZ CINTIQ. How to build a DIY Cintiq, it's  easier than a DIY PC! www.tabletmod.com
Pesho
Sr. Member
****
Posts: 253



View Profile
« Reply #4 on: January 24, 2012, 11:24:51 PM »

Hey DonShole,

Now i feel bad that i didn't upload the newest version of the script any sooner... Now everything is nicely commented and everything is set up through the custom "ResizeWin" command at the top. It lets you specify the size of the inner and outer rectangle without having to play with the border coordinates! For your case, you'd need to do something like:

ResizeWin(A_ScreenWidth,A_ScreenHeight,979,625)

Or, if you want the inside rectangle at a specific place (130px to the X and Y from the upper left corner of the screen):

ResizeWin(A_ScreenWidth,A_ScreenHeight,979,625,130,130)

Where A_ScreenWidth,A_ScreenHeight makes it stretch to the entire screen, or you can use absolute coordinates for the outer boundary.
Also, the second line (WinSet, Transparent, 0, ahk_class Shell_TrayWnd) is only there to hide the taskbar. You can remove or comment that out if you want it to be visible. The last newly added function is that it now returns the active window to where it was before you pressed the key.

Quote
how do you turn a script into an exe file ?

There is a "compiler" app that comes with AutoHotkey called "Ahk2Exe.exe", it's pretty straight forward. It allows adding a custom icon too if you wanna be fancy  Wink

The link to the updated script is the same: http://nik.benzinestudios.com/Razni/CenterWindow.zip
Logged
DonShole
Sr. Member
****
Posts: 169



View Profile WWW
« Reply #5 on: January 26, 2012, 01:49:44 AM »

Thanks!  That's really helpful Pesho  Smiley
Logged

EZ CINTIQ. How to build a DIY Cintiq, it's  easier than a DIY PC! www.tabletmod.com
Pages: [1]
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!