Click to See Complete Forum and Search --> : drawing in pictire boxes


bperteet
November 4th, 1999, 09:47 PM
Here's what i wanna do: i have a picture box and am loading an image into
it (a map), i can draw stuff on top of it with no problem, but what i want
to do is be able to draw another image on top of it and be able to move it
to another location and erase where it was last and restore the screen. By
XOR-ing it with the background i can do this, however the consequence is
that the colors change when doing it on a multicolor background, like a
photo. Basically, I want to be able to do what the mouse cursor does in
windows...does that makes sense? :)

i know i need to use WinAPI routines to do this but i'm not quite sure how
to go about it (it's gotta be a common thing though)

thanks in advance,

Brent Perteet
brent@okie-net.com

February 5th, 2000, 02:23 AM
Why don't you declare a variable of type Picture to hold the image of the map and use PaintPicture to paint the second image onto it?

Dim picPicture as Picture

private Sub Form_Load()
set picPicture = LoadPicture("Map")
picPictureBox.Picture = picPicture
End Sub

private Sub picPictureBox_MouseMove(X as Single, Y as Single) 'These are the only two we need.
picPictureBox.PaintPicture(LoadPicture("SecondImage"), 0, 0) 'PaintPicture(picture, x, y)
picPictureBox.Picture = picPicture.Image
End Sub