you have to check if the mouse is in the panel and then calculate the correct offset for your texture pixel
currently your accessing random memory (you move your bitmap, but you access it like it is in the top left corner)


Visit my site: www.masterq32.de