1
Graphics / sf::image::GetPixel
« on: February 07, 2010, 04:48:21 pm »
worked well! Thank you very much!
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.
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 );
}