# How to get section of pixels from entire screen?

**URL:** <https://discourse.processing.org/t/how-to-get-section-of-pixels-from-entire-screen/1480>\
**Category:** Beginners\
**Created:** [July 3, 2018, 11:21pm UTC](https://discourse.processing.org/t/how-to-get-section-of-pixels-from-entire-screen/1480 "2018-07-03T23:21:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grimtin10](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Grimtin10](https://discourse.processing.org/u/Grimtin10)\
**Post date:** [July 3, 2018, 11:21pm UTC](https://discourse.processing.org/t/how-to-get-section-of-pixels-from-entire-screen/1480/1 "2018-07-03T23:21:14Z")

</div>

I’m going to write a simple bot for a game, and I need to get a section of pixels (or at least one pixel) from the game. How do I do this?

-Grim

---

<div class="post-metadata">

**Author:** ![mat650](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mat650/32/564_2.png) [@mat650](https://discourse.processing.org/u/mat650)\
**Post date:** [July 4, 2018, 12:33am UTC](https://discourse.processing.org/t/how-to-get-section-of-pixels-from-entire-screen/1480/2 "2018-07-04T00:33:22Z")

</div>

I suggest you to look into nested loops like for(condition){statement for(condition){statement}} .  
I don’t know if this answer your question.  
Can you may be more specific?

---

<div class="post-metadata">

**Author:** ![Grimtin10](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Grimtin10](https://discourse.processing.org/u/Grimtin10)\
**Post date:** [July 4, 2018, 1:28am UTC](https://discourse.processing.org/t/how-to-get-section-of-pixels-from-entire-screen/1480/3 "2018-07-04T01:28:34Z")

</div>

No, I want to get pixels from the screen! But not the canvas.

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [July 4, 2018, 7:40am UTC](https://discourse.processing.org/t/how-to-get-section-of-pixels-from-entire-screen/1480/4 "2018-07-04T07:40:37Z")

</div>

Have a look at the Robot class. You should be able to get a screenshot and then modify it.

Kf

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [July 4, 2018, 8:00am UTC](https://discourse.processing.org/t/how-to-get-section-of-pixels-from-entire-screen/1480/5 "2018-07-04T08:00:43Z")

</div>

- [https://Forum.Processing.org/two/discussion/8025/take-a-screen-shot-of-the-screen#Item\_8](https://Forum.Processing.org/two/discussion/8025/take-a-screen-shot-of-the-screen#Item_8)

- [https://Forum.Processing.org/two/discussions/tagged?Tag=createscreencapture()](https://Forum.Processing.org/two/discussions/tagged?Tag=createscreencapture%28%29)
