Problem of Getpixel on PocketPC 2000 and PocketPC 2003

Discussion in 'Bug Reports' started by hung, Aug 20, 2007.

  1. hung

    hung Member Licensed User

    I use the following code to test Getpixel in Pocket PC2000/2003/WM5/WM6.

    The getpixel returns same values of the cRed/cGreen/cBlue constants in WM5 and WM6.

    But in PocketPC 2000 and PocketPC 2003, pointing on
    red circle returns -524288
    green circle returns -16744448
    blue cirlce returns - 16776968

    Any walk around resolve it?

    Sub Globals
    'Declare the global variables here.

    End Sub

    Sub App_Start
    label1.Text = "cRed = " & cRed & " RGB(255,0,0)" & Rgb(255,0,0)
    label1.Text = label1.Text & crlf & "cGreen = " & cGreen & " RGB(0,255,0)" & Rgb(0, 255,0)
    label1.Text = label1.Text & crlf & "cBlue = " & cBlue & " RGB(0,0,255)" & Rgb(0,0,255)

    form1.Circle(0, 120, 50, cRed, F)
    form1.Circle(100, 120, 50, cGreen, F)
    form1.Circle(180, 120, 50, cBlue, F)

    End Sub

    Sub Form1_MouseMove (x,y)
    label2.Text = form1.GetPixel(x, y)
    End Sub
  2. Cableguy

    Cableguy Expert Licensed User

    It has been brought up in another thread, and is suposed to be related to the maximum screen colors possible on the device...

    WM5 and WM6 devices support up to 65k colors, but older devices may not support as many colors thus giving diferent relation colors for the R,G,B factors, being the only twoo "standart" colors the black (0,0,0) and the white (255,255,255) or what ever maximum values are alowed...
  3. Erel

    Erel Administrator Staff Member Licensed User

    What you can do (at runtime) is to check the color of a known pixel and store it in a variable. Now compare other pixel's colors to this variable.
  4. hung

    hung Member Licensed User

    Yes. That works.

    I use a variable to keep the color immediately after the graph is draw, then use the variable to check against the getpixel.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice