Results 1 to 13 of 13

Thread: Convert between RGB<>Long<>Hex color values

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2008
    Location
    Between the keyboard and the chair.
    Posts
    122

    Convert between RGB<>Long<>Hex color values

    In this project, a few things are done. Mainly and principally, the user can convert color values between Long, Hex, and RGB values, with a Shape depicting the color itself. As you change values in one valuetype, the others are automatically updated.

    Some of the smaller examples in the code deal with textbox input manipulation, mainly limiting of input (both characters AND shift-insert, as well as rightclick-paste).

    While I understand that this may have been done before, I wanted to write this up, as I currently needed something like this in my own current projects, as well as gain experience in the making.

    Usage:
    Use the sliders or relevent text boxes to input RGB values, and the Long and Hex text boxes to enter Long and Hex values respectively. Please note there is no need for &H before hexvalues.

    Enjoy, and feel free to question about/comment on/rip up the code.

    Update:
    +Fixed the omission of Ctrl shortcuts
    +Added always on top checkbox <thanks CVMichael>
    +Added grabbing the pixelcolor under the mouse <once again, thanks CVMichael>
    +Added polling frequency for grabbing pixel color.

    Update:
    +Fixed broken Ctrl/Shift blocks
    +Partially removed oscillation when mouse is over the form's textboxes (timer is disabled when user clicks inside box)
    +Partially made way to temporarily pause timer while mouse is in form (I need superior ideas for how to know when mouse exits form!)
    *Need to remove oscillation using temporary disabling of timer.
    *Need to factor out blocking code (too tired at the moment, and not sure if exporting to a single function will work.)

    Update:
    +Added Click Drag targeting, in place of constant monitoring
    +Form now hides when targeting and mouse is over form
    +Factored out blocking code
    +Added zoomable review of location of mouse in targeting mode.
    +Incorperated code from members of this thread(Merri, CVMichael, Si_The_Geek, etc)
    *Possibly hook the textbox windows, to prevent cutting/pasting. (I have the code, just needs to be modified for more that one hook at a time)
    Attached Files Attached Files
    Last edited by EntityReborn; Sep 25th, 2008 at 05:12 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width