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. C#
  4. Scrolling background in C# Winform??

Scrolling background in C# Winform??

Scheduled Pinned Locked Moved C#
questioncsharphelp
3 Posts 3 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.
  • L Offline
    L Offline
    llonden2kx
    wrote on last edited by
    #1

    Hey guys, Im in the process of creating a 1941-type shooter set in outer space. I have a simple jpeg of distant stars I wanted to set as the background. How can achieve this? And if possible, how can I make it scroll as if my spaceship appears to be moving? Thanks for any help.

    D A 2 Replies Last reply
    0
    • L llonden2kx

      Hey guys, Im in the process of creating a 1941-type shooter set in outer space. I have a simple jpeg of distant stars I wanted to set as the background. How can achieve this? And if possible, how can I make it scroll as if my spaceship appears to be moving? Thanks for any help.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      That's going to be a problem. A scrolling background on a Windows form means that the background will be redrawing every time the image scrolls even one pixel. That will also force a redraw of every control on the form. The more controls you have, the more time it takes to generate a single frame in your game. The best solution you have is to use DirectX. But, that would require a complete rewrite of your game. You might want to look into Microsoft's XNA Developer's Center[^] first.

      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      1 Reply Last reply
      0
      • L llonden2kx

        Hey guys, Im in the process of creating a 1941-type shooter set in outer space. I have a simple jpeg of distant stars I wanted to set as the background. How can achieve this? And if possible, how can I make it scroll as if my spaceship appears to be moving? Thanks for any help.

        A Offline
        A Offline
        AFSEKI
        wrote on last edited by
        #3

        In 2D Games with the tpye you want: 1) There is a screen size background image and you draw onto a part of this big background image and update(Invalidate) just that part so because the user does see only a small portion of the big background image, he thinks he is moving in some directions ;) 2) Have a look at Code4Fun web site, where you can find some tutorials on game development. Hope this helps...

        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