CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 5 1234 ... LastLast
Results 1 to 15 of 73

Thread: [RESOLVED] Monitor Brightness

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Posts
    158

    [RESOLVED] Monitor Brightness

    I'm looking for a way to adjust the monitor's temperature. There's a program called f.lux that does this, but it doesn't get dark enough. The program I'm writing will be used on a boat and needs to be dark enough so that it's not blinding while driving at night.

    Any thoughts?

  2. #2
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,943

    Re: Monitor Temperature

    Temperature does not control brightness. It will only control blue to yellow hue.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Oct 2005
    Posts
    158

    Re: Monitor Temperature

    OK, thanks. Then I'll need to look for ways to change brightness, contrast and temp.

    Is it possible?

  4. #4
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,268

    Talking Re: Monitor Temperature

    One way to change the brightness is to change the Gamma component to give you a feeling that brightness is reduced. Actually the contrast is reduced.

    To do this, you'll need the SetDeviceGammaRamp API :

    Code:
     <DllImport("gdi32.dll")> _
        Private Shared Function SetDeviceGammaRamp(ByVal hDC As IntPtr, ByRef lpRamp As RAMP) As Boolean
        End Function
    I am attaching a working project ( in VB 2010 ) with
    Attached Files Attached Files
    [SIGPIC][/SIGPIC]
    All my Articles
    Hannes

  5. #5
    Join Date
    Oct 2005
    Posts
    158

    Re: Monitor Temperature

    Super cool. I'll take a look at this tonight.

  6. #6
    Join Date
    Oct 2005
    Posts
    158

    Re: Monitor Temperature

    I was able to look at it at work, and I think that's going to be part of the solution, but it just doesn't get it dark enough. I think I still need something with the brightness at least.

  7. #7
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,268

    Re: Monitor Temperature

    I'm afraid that is as good as it will get. I'll try to see what else I can come up with, but the SetDeviceGammaRamp API is sufficient 99&#37; of the time...
    [SIGPIC][/SIGPIC]
    All my Articles
    Hannes

  8. #8
    Join Date
    Oct 2005
    Posts
    158

    Re: Monitor Temperature

    I'll have to look at in the dark and see what it looks like in practice.

  9. #9
    Join Date
    Oct 2005
    Posts
    158

    Re: Monitor Temperature

    After looking at it in the dark, that may be just what the doctor ordered. Doesn't do much with an all white background, but in conjunction with wise color choices for the background could be just right. Thanks a bunch.

  10. #10
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,268

    Re: Monitor Temperature

    That's great news Glad you came right

    Please remember to mark your thread resolved if you feel you have solved this issue; it is explained here :

    http://www.codeguru.com/forum/showthread.php?t=403073
    [SIGPIC][/SIGPIC]
    All my Articles
    Hannes

  11. #11
    Join Date
    Oct 2005
    Posts
    158

    Re: [RESOLVED] Monitor Temperature

    I know this is marked resolved but I was wondering if there is a similar function to get the current gamma settings? I tried getDeviceGammaRamp, but from what I could tell that returns whether or not the devices is able to change the gamma.

  12. #12
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,268

    Re: [RESOLVED] Monitor Temperature

    Hi Stin

    Hmm, not sure that there is something, offhand

    Could you perhaps explain a bit more what you'd like to achieve then we can hopefully, possibly identify a solution

    Hannes
    [SIGPIC][/SIGPIC]
    All my Articles
    Hannes

  13. #13
    Join Date
    Oct 2005
    Posts
    158

    Re: [RESOLVED] Monitor Temperature

    The program will allow the user to change their gamma settings and then reset them when they leave. So really I just would like to capture what it's at when they start the program. The one you gave me starts at 14 or 18 which seams to be an arbitrary number.

  14. #14
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,268

    Re: [RESOLVED] Monitor Temperature

    I see

    We will have to use GetDeviceGammaRamp at Form load, then with the Form_Closing event set it to what was retrieved at Form load. That will reset it to the value it was before the program was run.

    Should I try to incorporate this into my previous example for you?

    Sorry, this was very sloppy programming on my side, I should have done that initially
    [SIGPIC][/SIGPIC]
    All my Articles
    Hannes

  15. #15
    Join Date
    Oct 2005
    Posts
    158

    Re: [RESOLVED] Monitor Temperature

    If it's not too much trouble that would fantastic. Using APIs isn't my forte, and as I mentioned, I tried using the getDeviceGammaRamp, but couldn't get it to work.

    Thank you so much for your help.

Page 1 of 5 1234 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)