Discussion Board

Results 1 to 5 of 5

Thread: Pixel's colour

  1. #1
    Registered User wuatta's Avatar
    Join Date
    Jul 2003
    Posts
    1
    In a class that extends the Canvas there is a method to Know the color of a determined pixel (colored previously )?
    Because when i re-Draw on the screen i lose the previously information of the colour...

    someone can help me?

    Thank you!

  2. #2
    Regular Contributor nmittal's Avatar
    Join Date
    Mar 2003
    Posts
    393
    There's no method but you can store the color in a variable before you repaint to another color.

    [N]/Forum Nokia

  3. #3
    Registered User doctordwarf's Avatar
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    wuatta, you can use Nokia UI API. There are two DirectGraphics.getPixels methods for this purpose. However, I consider them rather tricky to use, storing color value before painting may work more easily.

  4. #4
    Registered User Dess's Avatar
    Join Date
    Mar 2003
    Posts
    17
    doctordwarf, AFAIK u cannot getPixels of the real screen because the Image is not MUTABLE

  5. #5
    Registered User doctordwarf's Avatar
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    Dess, maybe you are right, I never tried it.
    Personally I rely on knowledge what I drew before rather then regetting this ingo from the screen.

    However, according to Javadoc supplied with the nokia simulators getPixels should work on any graphics context. Also it is known that you can paint only part of the screen letting other parts stay the same. This made me believe that getPixels could be used for getting color from a real screen.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved