Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: loading images  (Read 1719 times)

0 Members and 1 Guest are viewing this topic.

sludge

  • Newbie
  • *
  • Posts: 24
    • View Profile
loading images
« on: July 06, 2010, 08:50:48 am »
Whenever I display a sprite that I read from a file, instead of only displaying the small part of the image file I care about (my drawing), the contents of the entire file, including the whitespace, are displayed.

In essence, when I load an image, how can I choose to only read part of the image file as opposed to the entire thing?  How do I specify the range of pixels are of importance?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
loading images
« Reply #1 on: July 06, 2010, 08:57:23 am »
Code: [Select]
sprite.SetSubRect(the_area_that_you_want_to_display);
Laurent Gomila - SFML developer

 

anything