Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Overlapping Images with Windows Forms/PictureBox

Overlapping Images with Windows Forms/PictureBox

Scheduled Pinned Locked Moved .NET (Core and Framework)
winformsgame-devquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pcxboy
    wrote on last edited by
    #1

    Hello, I am designing a very basic video game, and I want an image to move relative to key presses. This image is on top of a background image. I use picture boxes, however there is a rectangle surrounding the image I wish to move, and it does not look right. Is there a way to make it so that the moving image appears to be part of the background image, so when I move it around? Much like any video game out there with characters that move. Thank you very much :-D Michael L. Allen

    M 1 Reply Last reply
    0
    • P pcxboy

      Hello, I am designing a very basic video game, and I want an image to move relative to key presses. This image is on top of a background image. I use picture boxes, however there is a rectangle surrounding the image I wish to move, and it does not look right. Is there a way to make it so that the moving image appears to be part of the background image, so when I move it around? Much like any video game out there with characters that move. Thank you very much :-D Michael L. Allen

      M Offline
      M Offline
      MoustafaS
      wrote on last edited by
      #2

      Don't use picturebox ,but use Graphics.DrawImage() as it will draw over the back ground and when you call this.Refresh(),It will re paint the back ground and you casn after this call immediatly draw it again in another location.

      P 1 Reply Last reply
      0
      • M MoustafaS

        Don't use picturebox ,but use Graphics.DrawImage() as it will draw over the back ground and when you call this.Refresh(),It will re paint the back ground and you casn after this call immediatly draw it again in another location.

        P Offline
        P Offline
        pcxboy
        wrote on last edited by
        #3

        Is there a specific way to call that function; I have tried this so far: Bitmap* MyImage; System::String* image = "Resource/wiggle.gif"; MyImage = new Bitmap(image); Graphics* Dr = new Graphics; Dr.DrawImage((dynamic_cast(MyImage)),50,50); however I get errors. Thank you very much for the help you have given me thus far. Mike

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups