you can first find out if the mouse pointer is inside the pixmap canvas.
then check out if the pixel that the pointer is on is transparent or not.
if not store the pixel.
then check out if the pixel that the pointer is on is transparent or not.
if not store the pixel.