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 7:10:52 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 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.ScreenBrightness.Adjust("10-");

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

//Set to 50 percent
ScreenBrightness.ScreenBrightness.Adjust("50%");

Edited by user Friday, August 6, 2021 2:00:18 PM(UTC)  | Reason: Updated to reflect syntax changes after version 0.5.0.0

thanks 2 users thanked Rob for this useful post.
2014218866 on 6/15/2019(UTC), randomConstant on 5/16/2022(UTC)
zyxi  
#2 Posted : Sunday, June 9, 2019 11:37:51 AM(UTC)
zyxi

Rank: Advanced Member

Reputation:

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

Thanks: 8 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/15/2019(UTC)
Rob  
#3 Posted : Sunday, June 9, 2019 2:17:31 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 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 : Saturday, June 15, 2019 5:10:12 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

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

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
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 11:54:04 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 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 1:54:07 PM(UTC)
2014218866

Rank: Advanced Member

Reputation:

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

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
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.