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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Question_Dude

Pages: [1]
1
Graphics / sf::image::GetPixel
« on: February 07, 2010, 04:48:21 pm »
worked well! Thank you very much!

2
Graphics / sf::image::GetPixel
« on: February 07, 2010, 04:22:30 am »
Hello. I just started messing with SFML for fun, i found something strange when trying to get colors per pixels, maybe (probably) i'm using something wrong, but still, here's what i'm getting:



Code: [Select]

img_Width = myImage.GetWidth ( );
img_Height = myImage.GetHeight ( );

for ( Uint32 i = 0; i != img_Width; ++i ) {
for ( Uint32 j = 0; j != img_Height; ++j ) {
const sf::Color color = myImage.GetPixel ( i, j );
std::cout << "Color of Pixel [i] x [j] \n";
std::cout << "Red = " << color.r;
std::cout << " Green = " << color.g;
std::cout << " Blue = " << color.b << std::endl;

}
}

testSprite.SetImage ( myImage );
}


i don't get why every GetPixel are returning an empty sf::Color, it's showing well on the window (it's the blue square with green border)

Pages: [1]