androidcanvasviewbitmapsource

Can a pixel also store information regarding strokes drawn on that part of the image?


I was learning about bitmaps and canvas and was curious about one thing . Does a pixel only store color information related to an image or also the strokes involved within a drawing .For example , if I just draw a circle on a canvas . Now , will the pixels in the bitmap related to the canvas also store what was drawn on the canvas or simply store the color of the circle?


Solution

  • Any shape in a bitmap is a combination of pixels and every pixel has a specific position(x,y) in a plane. A pixel only has a color code information. To get a color code of a specific pixel:

    int color = bitmap.getPixel(x,y)