DaniWeb Member Rules (which you agreed to when you signed up) include:
"Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules
You probably want a java.awt.image.BufferedImage. It has a method called getRGB which can give you the color of any pixel. If you have any other kind of java.awt.Image then you can start by constructing a BufferedImage of the same size. I'll call it bImage. Then you can call bImage.getGraphics() to allow you to draw your image onto bImage.
Don't forget to call dispose() on your graphics object, and be aware that not all Image objects are fully ready to be drawn. You may need to use an java.awt.image.ImageObserver or some other technique to wait for the image to be ready.
Dim Adapter As New OleDbDataAdapter
Dim Command As New OleDbCommand
Dim xFrom As String = dtpFrom.Value.ToString.Substring(0, dtpFrom.Value.ToString.IndexOf(" "))
Dim xTo As String = dtpTo.Value.ToString.Substring(0, dtpTo.Value.ToString.IndexOf(" "))
sqlQuery = MainQuery ...