Jump to content
  • Advertisement
Sign in to follow this  
Plerion

[GDI+] Repeating an image

This topic is 2998 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello!

Im making a repeating background with an image. It moves slowly downwards. When the upper border of the image gets into view it should then begin there with the lower border of the image. In DirectX i made that by reducing the texture coords and when it comes to negative values restarting at 1. Is there a similar way in GDI+?

Greetings
Cromon

Share this post


Link to post
Share on other sites
Advertisement
There is. First, you have to use a DrawImage overload with a ImageAttribute parameter. In the ImageAttribute you change the wrapping behaviour (SetWrapMode), in your case likely WrapModeTile.

Offsetting can be achieved by setting Graphics::SetTransform appropriately.
Can't say how simple this will be. You probably have to do a proper calculation for your "texcoord matrix".

Hope this gets you started.

unbird

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!