1. Are you ready for the Galaxy S20? Here is everything we know so far!

How do I simply set the color of a single pixel?

Discussion in 'Android Development' started by Videogamer555, Nov 8, 2019.

  1. Videogamer555

    Videogamer555 Lurker
    Thread Starter

    I want to be able to draw something, and the first step is to be able to set the color of a pixel? Once I can do that, I can set the color of all pixels as needed. First I need a control that supports drawing though. I've tried the ImageView and SurfaceView controls, and coded everything to work to set the color of a pixel. But it doesn't work. It seems that setting a pixel's color doesn't actually update the screen. So the pixel remains the same color on the screen. I need to know how to do this properly. Is there a way to force the screen to refresh and display the changed pixel color?

    One of the most important things in an app, is to be able to draw to the screen, especially if you want to display custom graphics or even write an image-editor app. It seems like such a basic concept to read or write the value of a pixel, but in Android it seems like an almost impossible task.
     



    1. Download the Forums for Android™ app!


      Download

       
  2. 23tony

    23tony Well-Known Member

    Direct pixel control is a pretty old approach - I used to do that with my Apple II in '78.

    I'm not even sure how it would work, since just about every device could have a different resolution.

    Am I understanding correctly: You're trying to create a drawing app?
     
    codesplice and mikedt like this.
Loading...
Similar Threads - simply set color
  1. Michael Culver
    Replies:
    2
    Views:
    148
  2. GiuseppeSM
    Replies:
    1
    Views:
    187
  3. icantchooseone
    Replies:
    2
    Views:
    224
  4. npuleio
    Replies:
    0
    Views:
    378
  5. Metro 9
    Replies:
    7
    Views:
    650
  6. JamesJoey
    Replies:
    2
    Views:
    309
  7. neil154
    Replies:
    7
    Views:
    829
  8. scottdave
    Replies:
    3
    Views:
    646
  9. neil154
    Replies:
    4
    Views:
    542
  10. Hakeem balogun
    Replies:
    0
    Views:
    528

Share This Page

Loading...