Results 1 to 13 of 13

Thread: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by step)

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by step)

    There are several good ColorPickers in the CodeBank, for example:

    (1) ColinE66's ColourPicker[vbRichClient]: http://www.vbforums.com/showthread.p...r-vbRichClient
    (2) Eduardo's Wheel Color Picker: http://www.vbforums.com/showthread.p...l-Color-Picker

    But I need a ColorPicker similar to PhotoShop's, because PhotoShop is the most widely used drawing tool in the world.

    wqweto wrote a very good ColorPicker similar to PhotoShop's 18 years ago, but its UI is so old that I can't use it in my projects. So I decided to rewrite wqweto's ColorPicker with vbRichClient5.Cairo.

    Although I've used RC5.Cairo in my Spread and CodeEditor, Cairo's syntax is completely different from VB6 GDI, so that as long as I don't use Cairo for 6 months, I'll completely forget Cairo's usage, and I need to start learning it from scratch. Therefore, I think it necessary to record the process of rewriting wqweto's ColorPicker with RC5.Cairo for others interested in learning Cairo drawing.

    It will take some time to rewrite wqweto's ColorPicker, because I need to spend a lot of time to search for information and test the usage of Cairo. Fortunately, Olaf has left a large number of Cairo examples on this forum. Searching these examples can solve almost all Cairo drawing problems.

    wqweto's real-time PhotoShop like color-picker
    http://www.planet-source-code.com/vb...xtCodeId=36529

    Note:
    My ultimate goal is to use RC5.Cairo to develop a professional and modern ColorPicker similar to PhotoShop's, which will be named vbColorPicker. If I have more time in the future, I'll rewrite Eduardo's Wheel Color Picker with Cairo and add it to vbColorPicker to form vbColorPickerPro. As for cwColorPicker, I need Olaf's help and guidance to complete it. Maybe ColinE66 is a better candidate to develop it.

    List of revisions:
    Code:
    2020-07-06
    - vbColorPicker Final
    
    2020-07-02
    - Add PopupPosition parameter to ShowEx function.
    - Improved FrmColorPicker
    
    Note:
    Now the vbColorPicker is basically completed.
    
    2020-07-01
    - Completely rewrote FrmColorPicker
    
    2020-06-30
    - Add CreateBarSat (DreamManor -- RC5.Cairo)
    - Add CreateRectSat (DreamManor -- RC5.Cairo)
    - Add CreateRectSatAccelerate (DreamManor -- RC5.Cairo)
    - Add CreateBarBri (DreamManor -- RC5.Cairo)
    - Add CreateRectBri (DreamManor -- RC5.Cairo)
    - Add CreateRectBriAccelerate (DreamManor -- RC5.Cairo)
    - Add Only-Web-Colors Test-Option
    - Improved SpinBox
    - Add vbColorPicker: FrmColorPicker(Beta)
    
    2020-06-28
    - Add cUpDown.cls (DreamManor -- RC5.Cairo)
    - Add SpinBox User Control (DreamManor)
    - Add SpinBox Test Page (DreamManor)
    
    2020-06-27 a.m.
    - Create Rect Hue (DreamManor -- RC5.Cairo)
    - Create Rect Hue (Acclerate) (DreamManor -- RC5.Cairo)
    - Create Rect RGB (DreamManor -- RC5.Cairo)
    - Add Speed Compare Module
    
    2020-06-26
    - Create Bar Hue (DreamManor -- RC5.Cairo)
    - Create Bar RGB (DreamManor -- RC5.Cairo)
    - Create Rect RGB (Acclerate) (DreamManor -- RC5.Cairo)
    
    2020-06-25 p.m.
    - Draw border on a picture(DreamManor -- RC5.Cairo)
    - Draw bar selector (DreamManor -- RC5.Cairo)
    - Draw bar selector (Olaf -- Best Practice)
    - Draw rect marker (DreamManor -- RC5.Cairo)
    
    2020-06-25
    - First released learning/rewriting framework
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by dreammanor; Jul 6th, 2020 at 05:45 AM.

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    2020-06-25
    - First released learning/rewriting framework
    Attached Files Attached Files

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    2020-06-25 p.m.
    - Draw border on a picture(DreamManor -- RC5.Cairo)
    - Draw bar selector (DreamManor -- RC5.Cairo)
    - Draw bar selector (Olaf -- Best Practice)
    - Draw rect marker (DreamManor -- RC5.Cairo)
    Attached Files Attached Files

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    2020-06-26
    - Create Bar Hue (DreamManor -- RC5.Cairo)
    - Create Bar RGB (DreamManor -- RC5.Cairo)
    - Create Rect RGB (Acclerate) (DreamManor -- RC5.Cairo)
    Attached Files Attached Files

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    2020-06-27 a.m.
    - Create Rect Hue (DreamManor -- RC5.Cairo)
    - Create Rect Hue (Acclerate) (DreamManor -- RC5.Cairo)
    - Create Rect RGB (DreamManor -- RC5.Cairo)
    - Add Speed Compare Module
    Attached Files Attached Files

  6. #6
    Addicted Member
    Join Date
    Jun 2016
    Location
    Espaņa
    Posts
    147

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    some examples of olaf do not work for me or show nothing.
    it cannot be compiled because the names of files or functions have more than 39 characters
    Greetings

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    Quote Originally Posted by yokesee View Post
    some examples of olaf do not work for me or show nothing.
    Because Olaf has not provided "Best Practice" code.

    The reason I reserved a place for Olaf in the test framework in advance is that if he has time to provide "Best Practice" code, I can easily add his code to my test framework. If he has no time to provide the code, then the existing code is enough to rewrite wqweto's ColorPicker.

    Quote Originally Posted by yokesee View Post
    it cannot be compiled because the names of files or functions have more than 39 characters
    Yes, I've shortened the class names, and now the project can be compiled.

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    2020-06-28
    - Add cUpDown.cls (DreamManor -- RC5.Cairo)
    - Add SpinBox User Control (DreamManor)
    - Add SpinBox Test Page (DreamManor)

    Note:
    The SpinBox is a very interesting user control, but there is a small problem, that is,
    the UpDown component in the SpinBox cannot refresh automatically (requires manual refresh), I'm looking for a solution. (This problem has been resolved and will be updated next time.)
    Attached Files Attached Files
    Last edited by dreammanor; Jun 28th, 2020 at 10:18 PM.

  9. #9

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    2020-06-30
    - Add CreateBarSat (DreamManor -- RC5.Cairo)
    - Add CreateRectSat (DreamManor -- RC5.Cairo)
    - Add CreateRectSatAccelerate (DreamManor -- RC5.Cairo)

    - Add CreateBarBri (DreamManor -- RC5.Cairo)
    - Add CreateRectBri (DreamManor -- RC5.Cairo)
    - Add CreateRectBriAccelerate (DreamManor -- RC5.Cairo)

    - Add Only-Web-Colors Test-Option
    - Improved SpinBox
    - Add vbColorPicker: FrmColorPicker(Beta)

    Note:
    FrmColorPicker is only a beta version (there are many bugs), mainly used to test SpinBox and Cairo drawing algorithms.After the test is complete, I'll completely rewrite the FrmColorPicker.
    Attached Files Attached Files
    Last edited by dreammanor; Jul 2nd, 2020 at 02:17 AM.

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    2020-07-01
    - Completely rewrote FrmColorPicker
    Attached Files Attached Files
    Last edited by dreammanor; Jul 1st, 2020 at 01:00 PM.

  11. #11

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    2020-07-02
    - Add PopupPosition parameter to ShowEx function.
    - Improved FrmColorPicker

    Note:
    Now the vbColorPicker is basically completed.
    Attached Files Attached Files
    Last edited by dreammanor; Jul 2nd, 2020 at 02:19 AM.

  12. #12

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    DrawColorBar_Hue and DrawColorBar_RGB do not handle the OnlyWebColors mode, I've corrected it and will upload the code next time.

  13. #13

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,070

    Re: ColorPicker similar to PhotoShop's (Learn vbRichClient5.Cairo drawing step by ste

    2020-07-06
    - vbColorPicker Final

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