Announcement

Collapse
No announcement yet.

ViSi ColorPicker

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • ViSi ColorPicker

    Hi,

    I want to use the ColorPicker object to send the 16bit colour via serial using ViSi, I saw an application note but it's for ViSi-Giene.
    Is the an application note for using ColorPicker in ViSi? How can I use this object to output the color in ViSi? Using uLCD-70DT.

    Thank you.

  • #2
    Hi,

    There is a sample program in Workshop 4 that you may be able to adapt. Click on File, Samples. In the list, click on Picaso VISI and then scroll down to colorpicker. Double click on colorpicker and then the project should open for you.

    I hope this helps

    Best regards

    Paul

    Comment


    • #3
      Thank you, I am trying to adopt the code, but I get this error message...

      Error: Can't open include file 'J:\documents\colorpickerConst.inc': No such file or directory (line 8 file:MAIN.4dg)
      Fatal error: errors in first pass(1), can't continue (line 4515 file:MAIN.4dg)

      Comment


      • #4
        Ok, I deleted the #inherit "colorpickerConst.inc" and it works.

        Thanks

        Comment


        • #5
          I suspect you have copied and pasted part of the colorpicker code into your ViSi program without understanding the function of 'colorpickerConst.inc'.

          Every ViSi program has / requires an inherit for 'programnameConst.inc'. If you just copied it from another program it would come up with no such file. If you had used 'Save As' workshop would have renamed it for you. If the correct file was completely missing you would have has quite a few compile errors.
          Mark

          Comment


          • #6
            Thank you, the colorpicker is now working and I want to send 16 bit color via serial to the PIC microcontroller, I used;

            serout((curcolor>>8)*0xff); //shift higher byte tothe right and send it out
            serout(curcolor*0xff); //send lower byte

            This does not seem to work. What is wrong?

            Comment


            • #7
              Hi

              Try

              serout((curcolor >> 8) & 0xff); //shift higher byte tothe right and send it out
              serout(curcolor & 0xff); //send lower byte

              Best regards

              Paul

              Comment


              • #8
                What is the maximum size for a colorpicker? when I use these settings:

                #constant cp1top 50
                #constant cp1left 180
                #constant cp1width 600
                #constant cp1height 340
                #constant cp1LpW cp1left+cp1width
                #constant cp1TpH cp1top+cp1height

                The color brightness adjust displays two different colors. I used the sample code and changed the display to uLCD-70DT and also changed the size of the colorpicker to the parameters stated below.

                // Colorpicker1 1.0 generated 10-Apr-18 7:24:11 AM
                img_Show(hndl,iColorpicker1) ;
                // Height 340
                // Left 180
                // Top 50
                // Width 600
                // Top of color area starts 6 pixels down and ends 6 pixels from bottom
                // HS area extends from left border to width - 33 pixels
                // L area extends from right border -22 to -6 pixels
                // Please refer to the Picaso, ViSi sample ColorPicker for a sample that demonstrates the usage of the colorPicker object

                Comment


                • #9
                  Originally posted by pauleilio View Post
                  Hi

                  Try

                  serout((curcolor >> 8) & 0xff); //shift higher byte tothe right and send it out
                  serout(curcolor & 0xff); //send lower byte

                  Best regards

                  Paul
                  Thanks it works

                  Comment


                  • #10
                    Originally posted by Phalits View Post
                    What is the maximum size for a colorpicker? when I use these settings:

                    #constant cp1top 50
                    #constant cp1left 180
                    #constant cp1width 600
                    #constant cp1height 340
                    #constant cp1LpW cp1left+cp1width
                    #constant cp1TpH cp1top+cp1height

                    The color brightness adjust displays two different colors. I used the sample code and changed the display to uLCD-70DT and also changed the size of the colorpicker to the parameters stated below.

                    // Colorpicker1 1.0 generated 10-Apr-18 7:24:11 AM
                    img_Show(hndl,iColorpicker1) ;
                    // Height 340
                    // Left 180
                    // Top 50
                    // Width 600
                    // Top of color area starts 6 pixels down and ends 6 pixels from bottom
                    // HS area extends from left border to width - 33 pixels
                    // L area extends from right border -22 to -6 pixels
                    // Please refer to the Picaso, ViSi sample ColorPicker for a sample that demonstrates the usage of the colorPicker object
                    What could be wrong? please assist.

                    Comment


                    • #11
                      Well, if you look in the sample code for the UpdateColorpicker function you will see
                      Code:
                                  for (i := 0; i < cp1height-12; i++)
                                      j := i * HLSMAX / (cp1height-12) ;
                                      HLS2RGB(h, j, s) ;
                                      gfx_Line(cp1LpW-22,cp1TpH-7-i,cp1LpW-7,cp1TpH-7-i,RGBs2COL(red,green,blue)) ;
                                  next
                      Knowing that you are limited to a 16 bit integer value, i.e. +32767 and that HLSMAX is 127 would seem to indicate that the maximum value for cp1height would be 270
                      Mark

                      Comment

                      Working...
                      X