# Processing

**URL:** https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=100

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 101

---

## [Running code on exit](https://discourse.processing.org/t/running-code-on-exit/33961)

<div class="topic-metadata">

**Author:** [@Cereal](https://discourse.processing.org/u/Cereal)\
**Replies:** 0\
**Last updated:** [December 6, 2021, 12:59pm UTC](https://discourse.processing.org/t/running-code-on-exit/33961 "2021-12-06T12:59:58Z")

</div>

Just wanted to verify this is a safe way of running code when the program exits: function setup() {} function draw() {} function dispose() { super.dispose() // Anything else I want cleaned up } Didn’t see any offi…

---

## [Choose random multiple entries from a StringList](https://discourse.processing.org/t/choose-random-multiple-entries-from-a-stringlist/33958)

<div class="topic-metadata">

**Author:** [@melo](https://discourse.processing.org/u/melo)\
**Replies:** 0\
**Last updated:** [December 6, 2021, 12:44pm UTC](https://discourse.processing.org/t/choose-random-multiple-entries-from-a-stringlist/33958 "2021-12-06T12:44:05Z")

</div>

Hello, Yesterday I was trying to pick three random entries from a StringList when you pressed a button. Ideally, the entry shouldn’t be repeated. I decided to shuffle() it once at the beggining, with three int which wou…

---

## [Different frameCount in the same code](https://discourse.processing.org/t/different-framecount-in-the-same-code/33937)

<div class="topic-metadata">

**Author:** [@Cosmin](https://discourse.processing.org/u/Cosmin)\
**Replies:** 2\
**Last updated:** [December 6, 2021, 4:03am UTC](https://discourse.processing.org/t/different-framecount-in-the-same-code/33937 "2021-12-06T04:03:30Z")

</div>

Hello, guys! I’m Cosmin and is a pleasure to be here. I have a question: it’s possible to have different frameCounts in the same definition? More exactly, I have two videos with different value of this function. In the f…

---

## [How to upload a mp4 file in p5 and then set it as background](https://discourse.processing.org/t/how-to-upload-a-mp4-file-in-p5-and-then-set-it-as-background/33949)

<div class="topic-metadata">

**Author:** [@anjali](https://discourse.processing.org/u/anjali)\
**Replies:** 0\
**Last updated:** [December 6, 2021, 2:04am UTC](https://discourse.processing.org/t/how-to-upload-a-mp4-file-in-p5-and-then-set-it-as-background/33949 "2021-12-06T02:04:33Z")

</div>

how to upload a mp4 file in p5 and then set it as background

---

## [Startup code runs more than once](https://discourse.processing.org/t/startup-code-runs-more-than-once/33922)

<div class="topic-metadata">

**Author:** [@hacketet](https://discourse.processing.org/u/hacketet)\
**Replies:** 4\
**Last updated:** [December 5, 2021, 9:41pm UTC](https://discourse.processing.org/t/startup-code-runs-more-than-once/33922 "2021-12-05T21:41:54Z")

</div>

I am developing a control system with numerouos buttons displayed on the monitor. Everything is working fine, however, I discovered that the startup code runs whenever I trigger a control. There is an empty draw sub - …

---

## [loadImage only if file exist](https://discourse.processing.org/t/loadimage-only-if-file-exist/33929)

<div class="topic-metadata">

**Author:** [@rizn](https://discourse.processing.org/u/rizn)\
**Replies:** 5\
**Last updated:** [December 5, 2021, 7:34pm UTC](https://discourse.processing.org/t/loadimage-only-if-file-exist/33929 "2021-12-05T19:34:57Z")

</div>

hi. i use loadImage() for a sketch, to read a lot of images from web and export it to pdf. its working fine. Is there a way to ask, if the image-file exist before using loadImage()? In my case, if some files dont exi…

---

## [How to make a photorealistic render in Processing?](https://discourse.processing.org/t/how-to-make-a-photorealistic-render-in-processing/33931)

<div class="topic-metadata">

**Author:** [@Nik](https://discourse.processing.org/u/Nik)\
**Replies:** 3\
**Last updated:** [December 5, 2021, 6:00pm UTC](https://discourse.processing.org/t/how-to-make-a-photorealistic-render-in-processing/33931 "2021-12-05T18:00:47Z")

</div>

Hello! How can i create a photorealistic 3D render in processing (as in the attached picture)?

---

## [Calculate maximum length of a vector](https://discourse.processing.org/t/calculate-maximum-length-of-a-vector/33818)

<div class="topic-metadata">

**Author:** [@travis.stdenis](https://discourse.processing.org/u/travis.stdenis)\
**Replies:** 11\
**Last updated:** [December 5, 2021, 3:29pm UTC](https://discourse.processing.org/t/calculate-maximum-length-of-a-vector/33818 "2021-12-05T15:29:08Z")

</div>

I’m trying to achieve the following calculation but i really don’t know what functions and equations to use in this situation. As you can see in the diagram, I have vector A and vector B and I know angle K and angle …

---

## [Trying to make a shape grow on its own](https://discourse.processing.org/t/trying-to-make-a-shape-grow-on-its-own/33939)

<div class="topic-metadata">

**Author:** [@Callum](https://discourse.processing.org/u/Callum)\
**Replies:** 2\
**Last updated:** [December 5, 2021, 3:08pm UTC](https://discourse.processing.org/t/trying-to-make-a-shape-grow-on-its-own/33939 "2021-12-05T15:08:52Z")

</div>

Hi, I’m very very new to Processing (just learned loops earlier today) and am trying to figure something out. I’m trying to make it so that when you click the screen, a circle of random size and colour shows up, and then…

---

## [Memory optimization and resizing](https://discourse.processing.org/t/memory-optimization-and-resizing/33878)

<div class="topic-metadata">

**Author:** [@F1yin](https://discourse.processing.org/u/F1yin)\
**Replies:** 3\
**Last updated:** [December 5, 2021, 2:06pm UTC](https://discourse.processing.org/t/memory-optimization-and-resizing/33878 "2021-12-05T14:06:08Z")

</div>

Hi everyone! I’m extremely new to processing and coding as a whole, and so I have many questions. But one, in particular, I haven’t been able to find on google. I am creating a GUI dashboard that will eventually interfa…

---

## [Help in Rotate Image in JAVA2D](https://discourse.processing.org/t/help-in-rotate-image-in-java2d/33852)

<div class="topic-metadata">

**Author:** [@avong](https://discourse.processing.org/u/avong)\
**Replies:** 4\
**Last updated:** [December 4, 2021, 11:05pm UTC](https://discourse.processing.org/t/help-in-rotate-image-in-java2d/33852 "2021-12-04T23:05:48Z")

</div>

please format code with \</\> button \* homework policy \* asking questions \<!- I have issues rotating image. I need help please. I wish to implement Flow Rate Meter. See the attached code. I have seen examples, but mo…

---

## [Find space in string](https://discourse.processing.org/t/find-space-in-string/33760)

<div class="topic-metadata">

**Author:** [@yalaniv](https://discourse.processing.org/u/yalaniv)\
**Replies:** 5\
**Last updated:** [December 4, 2021, 10:57pm UTC](https://discourse.processing.org/t/find-space-in-string/33760 "2021-12-04T22:57:08Z")

</div>

I have a sentece as a string, and I want to print in on the screen, each word in different line, but when I try to comapre if the current char is space, I get this error: cannot convert from char to String, regarding …

---

## [Scrambling an Image](https://discourse.processing.org/t/scrambling-an-image/33879)

<div class="topic-metadata">

**Author:** [@bcabc](https://discourse.processing.org/u/bcabc)\
**Replies:** 4\
**Last updated:** [December 2, 2021, 9:28pm UTC](https://discourse.processing.org/t/scrambling-an-image/33879 "2021-12-02T21:28:25Z")

</div>

Hi- I’d like to rearrange a JPG’s pixels so that they were in random order - preferably in 4x4 blocks. I’m having a little trouble figuring this out. I was hoping something like the following would work - but it doesn’…

---

## [Is possible use Processing library (ex. Network Library) on p5.js?](https://discourse.processing.org/t/is-possible-use-processing-library-ex-network-library-on-p5-js/33919)

<div class="topic-metadata">

**Author:** [@Stefano](https://discourse.processing.org/u/Stefano)\
**Replies:** 1\
**Last updated:** [December 4, 2021, 1:36pm UTC](https://discourse.processing.org/t/is-possible-use-processing-library-ex-network-library-on-p5-js/33919 "2021-12-04T13:36:50Z")

</div>

Hello everybody, I want do the example of the Network Library of Processing “Shared drawing canvas” using my MAC with the Processing code as a server and my IPad with Processing.app (p5.js) as a client, how can this be …

---

## [Is possible use Shared drawing canvas (example code) on P5.js (IPad)?](https://discourse.processing.org/t/is-possible-use-shared-drawing-canvas-example-code-on-p5-js-ipad/33917)

<div class="topic-metadata">

**Author:** [@Stefano](https://discourse.processing.org/u/Stefano)\
**Replies:** 0\
**Last updated:** [December 4, 2021, 12:34pm UTC](https://discourse.processing.org/t/is-possible-use-shared-drawing-canvas-example-code-on-p5-js-ipad/33917 "2021-12-04T12:34:51Z")

</div>

Hello everybody, I want do the example of the Network Library of Processing “Shared drawing canvas” using my MAC with the processing code as a server and my IPad with Processing.app (p5.js) as a client, how can this be …

---

## [X=y=z doesn't return error](https://discourse.processing.org/t/x-y-z-doesnt-return-error/33912)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 3\
**Last updated:** [December 4, 2021, 9:31am UTC](https://discourse.processing.org/t/x-y-z-doesnt-return-error/33912 "2021-12-04T09:31:05Z")

</div>

I was making a simple project, when I mistyped the code and ended with this. What does it do? Why doesn’t it return an error? Why is ON underlined in yellow? Doesn’t it change? Or is it because it is not used later in …

---

## [How do I get the line to stop at the edge?](https://discourse.processing.org/t/how-do-i-get-the-line-to-stop-at-the-edge/33894)

<div class="topic-metadata">

**Author:** [@chaotic.rabbit](https://discourse.processing.org/u/chaotic.rabbit)\
**Replies:** 1\
**Last updated:** [December 4, 2021, 12:24am UTC](https://discourse.processing.org/t/how-do-i-get-the-line-to-stop-at-the-edge/33894 "2021-12-04T00:24:22Z")

</div>

Hi, I’ve been trying to draw a blue line like the one shown in the image that passes through 2 given points (red points) and ends as soon as it touches the black line (which i know the x position of but I dont know the y…

---

## [Is possible Shared drawing canvas between Processing (on MAC) and P5.js?](https://discourse.processing.org/t/is-possible-shared-drawing-canvas-between-processing-on-mac-and-p5-js/33909)

<div class="topic-metadata">

**Author:** [@Stefano](https://discourse.processing.org/u/Stefano)\
**Replies:** 0\
**Last updated:** [December 3, 2021, 10:16pm UTC](https://discourse.processing.org/t/is-possible-shared-drawing-canvas-between-processing-on-mac-and-p5-js/33909 "2021-12-03T22:16:10Z")

</div>

Hello everybody, I want do the example of the Network Library of Processing “Shared drawing canvas” using my MAC with the processing code as a server and my IPad with Processing.app (p5.js) as a client, how can this be…

---

## [2d camera in Processing follow up](https://discourse.processing.org/t/2d-camera-in-processing-follow-up/33890)

<div class="topic-metadata">

**Author:** [@SNICKRS](https://discourse.processing.org/u/SNICKRS)\
**Replies:** 4\
**Last updated:** [December 3, 2021, 9:47pm UTC](https://discourse.processing.org/t/2d-camera-in-processing-follow-up/33890 "2021-12-03T21:47:00Z")

</div>

Similarly to my last post, I am trying to make a 2d camera in processing. So far, I have the camera “look” where the character points towards the mouse, but I can’t find anything to help me with camera movement in 2d. Ar…

---

## [Export PDF on child PApplet](https://discourse.processing.org/t/export-pdf-on-child-papplet/33903)

<div class="topic-metadata">

**Author:** [@MonoRail](https://discourse.processing.org/u/MonoRail)\
**Replies:** 0\
**Last updated:** [December 3, 2021, 8:11pm UTC](https://discourse.processing.org/t/export-pdf-on-child-papplet/33903 "2021-12-03T20:11:32Z")

</div>

I’m writing a program with a GUI (ControlP5) in which the parent PApplet contains the textfields with parameters and a button to export to PDF. I want the child PApplet to contain all of the drawn information and export …

---

## [Processing javadoc](https://discourse.processing.org/t/processing-javadoc/33893)

<div class="topic-metadata">

**Author:** [@WhiteSte](https://discourse.processing.org/u/WhiteSte)\
**Replies:** 0\
**Last updated:** [December 3, 2021, 11:50am UTC](https://discourse.processing.org/t/processing-javadoc/33893 "2021-12-03T11:50:57Z")

</div>

Dear guys, I’m using processing 4 inside the visual studio editor. For doing so, I imported the processing jars inside my project. Here the screenshots : My question: how can i import processing javadoc inside my e…

---

## [How to introduce gradient into ellipse](https://discourse.processing.org/t/how-to-introduce-gradient-into-ellipse/33863)

<div class="topic-metadata">

**Author:** [@srb777](https://discourse.processing.org/u/srb777)\
**Replies:** 1\
**Last updated:** [December 1, 2021, 9:41pm UTC](https://discourse.processing.org/t/how-to-introduce-gradient-into-ellipse/33863 "2021-12-01T21:41:39Z")

</div>

Hi, I am learning to program with processing and I need help.I need to paint the balls with gradient, It has to look like this: My code: int columns = 20; // Número de columnes int rows = 10; // Número de files floa…

---

## [How to randomly change the background color between 'X' amount of static colors with each output](https://discourse.processing.org/t/how-to-randomly-change-the-background-color-between-x-amount-of-static-colors-with-each-output/33880)

<div class="topic-metadata">

**Author:** [@sloppy](https://discourse.processing.org/u/sloppy)\
**Replies:** 2\
**Last updated:** [December 2, 2021, 4:16pm UTC](https://discourse.processing.org/t/how-to-randomly-change-the-background-color-between-x-amount-of-static-colors-with-each-output/33880 "2021-12-02T16:16:21Z")

</div>

I’ve been trying this for a couple of days and can never seem to get it right with what I imagine would be a simple piece of syntax/code. Each generated image’s background I want to either be between -1 to 256, and also…

---

## [Daft question about variable using mouseX and mouseY](https://discourse.processing.org/t/daft-question-about-variable-using-mousex-and-mousey/33875)

<div class="topic-metadata">

**Author:** [@AudioBabble](https://discourse.processing.org/u/AudioBabble)\
**Replies:** 5\
**Last updated:** [December 2, 2021, 1:15pm UTC](https://discourse.processing.org/t/daft-question-about-variable-using-mousex-and-mousey/33875 "2021-12-02T13:15:32Z")

</div>

I have a daft question… why do get no output when I define a variable using mouseX & mouseY? int XY = mouseX+mouseY; void draw() { println(XY,mouseX+mouseY); } left-hand number stays at zero, right hand number cha…

---

## [Is Processing a pure Java platform IDE?](https://discourse.processing.org/t/is-processing-a-pure-java-platform-ide/33821)

<div class="topic-metadata">

**Author:** [@R1S8K](https://discourse.processing.org/u/R1S8K)\
**Replies:** 2\
**Last updated:** [December 2, 2021, 7:13am UTC](https://discourse.processing.org/t/is-processing-a-pure-java-platform-ide/33821 "2021-12-02T07:13:19Z")

</div>

Hi, I downloaded eclipse to test some java snippets and examples. My question now, is the coding system in Processing is exactly the same as in other IDE like eclipse ?

---

## [Two objects in one](https://discourse.processing.org/t/two-objects-in-one/33871)

<div class="topic-metadata">

**Author:** [@tati1202](https://discourse.processing.org/u/tati1202)\
**Replies:** 0\
**Last updated:** [December 1, 2021, 10:32pm UTC](https://discourse.processing.org/t/two-objects-in-one/33871 "2021-12-01T22:32:12Z")

</div>

Hi, I want to unite the class Juego with the Class Pantallas to replace the golBayernD screen. How can I do this? Here’s the code: GitHub - BautiFelli/tecnomultimedia at tp6

---

## [Robot down key not working](https://discourse.processing.org/t/robot-down-key-not-working/33838)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 2\
**Last updated:** [November 30, 2021, 7:29pm UTC](https://discourse.processing.org/t/robot-down-key-not-working/33838 "2021-11-30T19:29:21Z")

</div>

why does this robot not pres the down key? import java.awt.AWTException; import java.awt.Robot; import java.awt.event.KeyEvent; Robot robot; void setup() { size(400, 400); //Let's get a Robot... try { robo…

---

## [Processing.net questions using Client / Server](https://discourse.processing.org/t/processing-net-questions-using-client-server/33860)

<div class="topic-metadata">

**Author:** [@yodan](https://discourse.processing.org/u/yodan)\
**Replies:** 1\
**Last updated:** [December 1, 2021, 2:57pm UTC](https://discourse.processing.org/t/processing-net-questions-using-client-server/33860 "2021-12-01T14:57:56Z")

</div>

Two clarifying questions regarding the processing.net library: When I use the Client constructor is there a way to control the timeout variable? The default is about 10-15s before it throws a timed out exception which …

---

## [Webcam capture fails for .exe on win10](https://discourse.processing.org/t/webcam-capture-fails-for-exe-on-win10/33834)

<div class="topic-metadata">

**Author:** [@mario60](https://discourse.processing.org/u/mario60)\
**Replies:** 2\
**Last updated:** [December 1, 2021, 1:44pm UTC](https://discourse.processing.org/t/webcam-capture-fails-for-exe-on-win10/33834 "2021-12-01T13:44:30Z")

</div>

Hi I am trying a simple webcam script on a Win10 machine, which runs fine. Still, the exported .exe fails, I do believe because it fails to upload GStreamer. Note folder structure is created as: script\_win64 – java …

---

## [Trying to draw a shape based on two circles](https://discourse.processing.org/t/trying-to-draw-a-shape-based-on-two-circles/33841)

<div class="topic-metadata">

**Author:** [@LucaP](https://discourse.processing.org/u/LucaP)\
**Replies:** 6\
**Last updated:** [December 1, 2021, 1:13pm UTC](https://discourse.processing.org/t/trying-to-draw-a-shape-based-on-two-circles/33841 "2021-12-01T13:13:55Z")

</div>

Hi, I am trying to draw a shape like this: It is important that the top and bottom of the shape match the radius of a perfect circle. I have tried doing this with shapes and beziérs but I can’t get my head around to…

[Previous page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=99)

[Next page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=101)
