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

Author Topic: Get pixel from window  (Read 2690 times)

0 Members and 2 Guests are viewing this topic.

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Get pixel from window
« on: March 02, 2015, 10:07:45 am »
Exscuse me. Is there any fast way to get every the window pixel with knowledge of pixel coordinates?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Get pixel from window
« Reply #1 on: March 02, 2015, 10:15:13 am »
"Fast" is a relative term. The only way to get a specific pixel is through sf::Image::getPixel(). To get an image instance of the window content you could draw to a render texture and then copy the texture content to an image. This procedure is however not very fast, so it really depends what you want to do.

If you just want to manipulate the pixel, you're better off using a shader, which would also be the fastest way.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything