StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Rob  
#1 Posted : Saturday, June 8, 2019 1:10:52 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 401
United States

Thanks: 5 times
Was thanked: 78 time(s) in 68 post(s)
Simple class to adjust the brightness of your screen. Note: This only works if your screen supports brightness adjustment!

I simply took the source in this project and changed a couple things: https://github.com/JeroenvO/screen-brightness

https://www.strokesplus.net/files/ScreenBrightness.dll

Download the file into your StrokesPlus.net\Plug-Ins folder and Reload S+.net from the tray icon.


NOTE: Windows may mark the DLL as unsafe or blocked. Right click the DLL and select Properties, there will be an option to unblock it.

Example script:
Code:
//Decrease by 10 percent
ScreenBrightness.Adjust("10-");

//Increase by 10 percent
ScreenBrightness.Adjust("10+");

//Set to 50 percent
ScreenBrightness.Adjust("50%");
thanks 1 user thanked Rob for this useful post.
2014218866 on 6/14/2019(UTC)
zyxi  
#2 Posted : Sunday, June 9, 2019 5:37:51 AM(UTC)
zyxi

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 3/30/2019(UTC)
Posts: 49
China

Thanks: 4 times
Was thanked: 1 time(s) in 1 post(s)
Dear Rob, thank you for providing such a good DLL, but there are two questions:

1) "ScreenBrightness. Adjust ("10-"); doesn't work, and the other two work normally.
2) It can't be continuously adjusted by the roller. It can work after loosening the right button and then pressing it again.


UserPostedImage
thanks 1 user thanked zyxi for this useful post.
2014218866 on 6/14/2019(UTC)
Rob  
#3 Posted : Sunday, June 9, 2019 8:17:31 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 401
United States

Thanks: 5 times
Was thanked: 78 time(s) in 68 post(s)
Not sure, all three combinations work on my computer. Like I said, I simply grabbed some random DLL that someone else made, so it might have some issues with some systems.

I can try to look later and see if there's something I'm missing.
2014218866  
#4 Posted : Friday, June 14, 2019 11:10:12 PM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 50
China

Thanks: 9 times
Dear Rob,
I found that the brightness reduction adjustment is discontinuous, from 100 to 80, by 10 at a time, then from 80 to 60 directly, and from 60 to 30 directly.
More importantly, it can no longer reduce brightness after 30, it can not be used as normal as increasing brightness.

Can you help me? Thank you
Rob  
#5 Posted : Saturday, June 15, 2019 5:54:04 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 401
United States

Thanks: 5 times
Was thanked: 78 time(s) in 68 post(s)
I did not write the code for the brightness adjustment, I just took some code that person wrote and compiled it from here https://github.com/JeroenvO/screen-brightness.

Screen brightness is a very challenging task due to different hardware/software support, so it does not always function consistently for different computers.

I'll try to come back to this another time to see if I can find anything.
2014218866  
#6 Posted : Wednesday, June 19, 2019 7:54:07 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 50
China

Thanks: 9 times
Thank you, Rob. I'm looking forward to it working properly on my computer.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.