• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to set a Background that not stretch?

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

I'm trying to set a background image in a app with some code like:

Image2D backgroundImage2D = new Image2D( Image2D.RGB, backgroundImage );
background.setImage(backgroundImage2D);

In paint I paint it like:
graphics3D.bindTarget(g);

try
{
graphics3D.clear(background);
graphics3D.render(world, worldTransform);
}
finally
{
graphics3D.releaseTarget();
}

But the problem is that the image is stretched over the screen. I would like it to stay in center and not be stretched.

So if you guys got any ideas please let me know.

Best regards
Fredrik
reply
    Bookmark Topic Watch Topic
  • New Topic