Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st March 2015, 09:38   #1  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
SOLVED:- XP Screen color inversion

Anyone know how to get screen color inversion on XP ?
I sometimes use computer for extended periods and especially when using reading glasses, find myself 'snow blind' for several days. It would be nice if I could change to eg white text on black in web pages and compiler IDE at the flick of a switch.

I've tried the accessories Utility Manager stuff but that is rubbish, and when undone can leave everything 'out of whack', ie fonts stuck at wrong size and weird borders, ended up re-installing my m/c last time I tried that.

I know that W7 has facility to do this (dont need advice to change OS), but XP lacks anything suitable as far as I know.
You can change GammaRamp, but that is not really what I want.
On W7 there is a (EDIT: Shareware) util called PowerStrip but that only works for some video cards.

I have recently found an AutoIt script which I'm using to control GammaRamp [TinyBrightnessControl (https://www.google.co.uk/?gws_rd=ssl...control+autoit)]
and have tried modding to invert colors but there seems to be some kind of check on validity which dont like the inversion, and it does nothing.

Any suggestions ?

EDIT: Here some CPP source from NirSoft, Changing the screen brightness programmingly:-
http://www.nirsoft.net/vc/change_screen_brightness.html
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 23rd March 2015 at 19:28. Reason: Solved
StainlessS is offline   Reply With Quote
Old 21st March 2015, 14:36   #2  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
Investigate here:

Here
Power Toys does many things.

And Here.
" TweakUI: Amp up Windows XP with a PowerToy that changes the default user interface. For advanced computer users only."

Perhaps an advanced user of files.reg can do something about it.

Last edited by GMJCZP; 21st March 2015 at 14:46.
GMJCZP is offline   Reply With Quote
Old 22nd March 2015, 03:15   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
GMJCZP, thanks for the links, downloaded pretty much anything I found and was working my way through them.
Had almost given up hope when I found a web page with a reg hack which had only been tried on W7.
I tried the hack without much expectation, and it did not work, as an afterthough I tried a reboot and again
retried a hacked version of the Nirsoft CPP code (link posted above), to my surprise, IT WORKED !
So, I'm gonna see if I can knock up a mod of the AutoIt TinyBrightnesscontrol to invert GammaRamp, should be able to get it to work.

Anyways, here is the fix

UnlockGammaRange.reg
Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM]
"GdiIcmGammaRange"=dword:00000100
From this link here: http://jonls.dk/2010/09/windows-gamma-adjustments/
which is an 'aside page' of the page: http://jonls.dk/redshift/

and the CPP hack of Nirsoft code, SetBrightness function, hack in blue
Code:
BOOL CGammaRamp::SetBrightness(HDC hDC, WORD wBrightness)
{
	/*
	Changes the brightness of the entire screen.
	This function may not work properly in some video cards.

	The wBrightness value should be a number between 0 and 255.
	128 = Regular brightness
	above 128 = brighter
	below 128 = darker

    If hDC is NULL, SetBrightness automatically load and release 
	the display device context for you.

	*/
	BOOL bReturn = FALSE;
	HDC hGammaDC = hDC;

	//Load the display device context of the entire screen if hDC is NULL.
	if (hDC == NULL)
		hGammaDC = GetDC(NULL);

	if (hGammaDC != NULL)
	{
		//Generate the 256-colors array for the specified wBrightness value.
		WORD GammaArray[3][256];

		for (int iIndex = 0; iIndex < 256; iIndex++)
		{
			int iArrayValue = (255-iIndex)<<8;
//			int iArrayValue = iIndex * (wBrightness + 128);

			if (iArrayValue > 65535)
				iArrayValue = 65535;

			GammaArray[0][iIndex] = 
			GammaArray[1][iIndex] = 
			GammaArray[2][iIndex] = (WORD)iArrayValue;
			
		}

		//Set the GammaArray values into the display device context.
		bReturn = SetDeviceGammaRamp(hGammaDC, GammaArray);
	}

	if (hDC == NULL)
		ReleaseDC(NULL, hGammaDC);

	return bReturn;
}
Again thanks

EDIT: Above Nirsoft CPP hack will ONLY invert, will not restore original settings, BEWARE !!! (Reboot will restore OK)

EDIT: To delete the ICM Gamma Unlock value inserted into the registry by earlier .reg file

LockGammaRange.reg
Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM]
"GdiIcmGammaRange"=-
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 22nd March 2015 at 17:52.
StainlessS is offline   Reply With Quote
Old 22nd March 2015, 03:28   #4  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
I suspected it had something to do with the registry. This solution and as knowledge of PowerToys for XP should be useful for everyone.
GMJCZP is offline   Reply With Quote
Old 22nd March 2015, 03:53   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Just posted a request for screen invert util on NirSoft site (http://www.nirsoft.net), I'm sure he will do a better job of it than I.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 22nd March 2015, 22:58   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
ScreenInverterXP-Readme.txt
Code:
ScreenInverterXP

Original thread, here:- http://forum.doom9.org/showthread.php?t=171949

Registry unlock/lock .reg scripts sourced from here:- http://jonls.dk/2010/09/windows-gamma-adjustments/

CPP code (slightly modified) to create Screen-Invert.exe/Screen-Restore.exe:- http://www.nirsoft.net/vc/change_screen_brightness.html


Two .exe files,
  Screen-Invert.exe, Does photo-negative invert on screen. perhaps easier on the eyes at night.
  Screen-Restore.exe, Restore back to normal.
  
  Before you can use Screen-Invert.exe, need to run UnlockGammaRange.reg registry editing script otherwise it dont work.
     May not work on all graphics cards, depends if GammRamp settings are supported by card.
     Will require reboot after running registry editing scripts. EDIT: Probably need run as Admin.
     
     
  To delete the registry setting and restore as before running UnlockGammaRange.reg, run LockGammaRange.reg.


  
As well as adding the GammaRamp.SetInvert() function to Brightness.cpp, we also modified main.cpp

To create (before renaming to) Screen-Invert.exe we used
>>>>>>>>>>>>>>>>>>>>>>>>>
#include <windows.h>
#include "gammaramp.h"

int WINAPI WinMain(
  HINSTANCE hInstance,      // handle to current instance
  HINSTANCE hPrevInstance,  // handle to previous instance
  LPSTR lpCmdLine,          // command line
  int nCmdShow              // show state
) {
	CGammaRamp GammaRamp;
	GammaRamp.SetInvert(NULL);
	Sleep(1000);	// wait a while till done
	return 0;
}
<<<<<<<<<<<<<<<<<<<<<<<<<


And To create (before renaming to) Screen-Restore.exe we used
>>>>>>>>>>>>>>>>>>>>>>>>>
#include <windows.h>
#include "gammaramp.h"

int WINAPI WinMain(
  HINSTANCE hInstance,      // handle to current instance
  HINSTANCE hPrevInstance,  // handle to previous instance
  LPSTR lpCmdLine,          // command line
  int nCmdShow              // show state
) {
	CGammaRamp GammaRamp;
	GammaRamp.SetBrightness(NULL, 128); 	//Return back to normal:
	Sleep(1000);	// wait a while till done
	return 0;
}
<<<<<<<<<<<<<<<<<<<<<<<<<

I'm putting both of mine on hot-keys.

StainlessS
Couple of small binaries and source in sig @MediaFire (below this post) in the UTILITY Folder.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 1st July 2020 at 12:39.
StainlessS is offline   Reply With Quote
Old 23rd March 2015, 13:12   #7  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
We conclude that there is finally white smoke in this topic. Thank You StainlessS.
GMJCZP is offline   Reply With Quote
Old 23rd March 2015, 19:27   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Yep thanx, white smoke. I'm still hoping that Nir Sofer (NirSoft) will do a utility but consider problem solved either way.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 23rd March 2015, 20:59   #9  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
Quote:
Originally Posted by GMJCZP View Post
We conclude that there is finally white smoke in this topic.
Given the topic itself, wouldn't it be black smoke?
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 24th March 2015, 17:43   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Nope, white smoke (it just looks black).

By the way, I downloaded the RedShift (night vision) thing mentioned in earlier post, comes up as 'not a valid executable' or words to that effect,
so dont bother with it.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Reply

Tags
gamma, invert, negative

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:40.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.