CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 1999
    Posts
    1

    drawing in pictire boxes

    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
    [email protected]





  2. #2
    Guest

    Re: drawing in pictire boxes

    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






Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured