Questions tagged [pgraphics]
26 questions
3
votes
1 answer
tint() on createGraphics() buffer in p5
I'm trying to change the opacity of an offscreen graphics buffer in p5, and can't figure it out.
consider:
var pg = createGraphics(...)
var image = loadImage(...)
tint(255, 50)
image(image, 0, 0) <----- this works
image(pg, 0, 0) <----- but this…

defenestrated
- 129
- 7
3
votes
1 answer
How to convert km into pixels in UnfoldingMap
I am using UnfoldingMap library. I have created a map and few markers. I want to show a circle around the marker. I am using the given code where x and y are coordinates and radius is radius in km. Ya I know I can't use km radius directly I have to…

Rahul Kumar
- 2,184
- 3
- 24
- 46
2
votes
1 answer
PGraphics + noSmooth() + alpha = drawing artifacts
Note: I also asked this question on the Processing forum here.
I have this sample code:
PGraphics pg;
void setup() {
size(400, 500);
pg = createGraphics(width, height);
pg.noSmooth();
pg.beginDraw();
pg.background(0, 0, 255);
…

Kevin Workman
- 41,537
- 9
- 68
- 107
1
vote
2 answers
PGraphics with background(); in Processing
I am trying to draw ellipses from an array list onto a PGraphics layer. This works so far. However, I need to give the PGraphics layer a white background. The moment I add the background, I can't add any more ellipses by mouse click. I have already…

Cyrill
- 833
- 2
- 6
- 16
1
vote
1 answer
How to draw pgraphics with different opacity out of an array?
i am trying to draw this 5 rectangles with an array but they have all the same opacity...
But they should have different but i dont now why?
Does someone can help me?
Thank you in advance :)
Sebastian
PGraphics[] pgArray = new PGraphics[5];
void…

Sebastian Haiduk
- 13
- 3
1
vote
1 answer
Draw permanently on PGraphics (Processing)
I would like to create a brush for drawing on a PGraphics element with Processing. I would like past brush strokes to be visible. However, since the PGraphics element is loaded every frame, previous brush strokes disappear immediatly.
My idea was…

kaktus
- 169
- 1
- 1
- 11
1
vote
1 answer
Make PGraphic Object the cursor
This is a follow-up of my question: Make the cursor a self-drawn image.
I have a paint a picture application. The latest working version can be found here: https://knowledgeablekangaroo.github.io/paint-a-picture-backup/, where the code can be found…

Marvin
- 853
- 2
- 14
- 38
1
vote
1 answer
Processing:Transparent Image Array
I'm new to processing and I got stuck on this:
Aim: I want to make an array of transparent images, shown one at a time after each mousePressed ()
Problem: What happens is due to the fact that there is an alpha transparency on all images, they…

K___S
- 21
- 2
1
vote
2 answers
PGraphics seems to get cleared or frozen whenever drawn to main context
My ultimate goal is to create a "tunnel effect" as I draw a rect to a buffer, copy the buffer to another buffer, and on subsequent draw(), copy the second buffer back to the first, only slightly smaller, then draw over top of that and repeat.
I'm…

Tom Auger
- 19,421
- 22
- 81
- 104
1
vote
1 answer
PGraphics set different colormode not working
I have the following code:
import processing.video.*;
import oscP5.*;
import netP5.*;
//sending the data to wekinator
int numPixelsOrig, numPixels, boxWidth = 64, boxHeight = 48, numHoriz = 640/boxWidth, numVert = 480/boxHeight;
color[] downPix =…

FutureCake
- 2,614
- 3
- 27
- 70
1
vote
1 answer
Processing: Get position of PGraphics object
Hi I need to make some widgets with Processing, for which I'm considering wrapping things together with a customized subclass of PGraphics. Then I'll be able to drag them around.
The current problem is, how do I get the position of a PGraphics…

Xun Yang
- 4,209
- 8
- 39
- 68
1
vote
1 answer
Null pointer exception when refactoring the creation of an ArrayList of PGraphics from the main class into a separate class
I'm writing a Processing Applet in Java using Eclipse. I keep getting a null pointer exception when I refactor a method to create an ArrayList of PGraphics from the main class into a separate class. The method written all in the main class works…

gromiczek
- 2,970
- 5
- 28
- 49
1
vote
1 answer
(Processing) PGraphics doesn't update when all pixels copied from another PGraphics
I have a small problem with PGraphics. I have folowing piece of code extracted from larger project I am working on:
int x=0;
int y=0;
PGraphics array1;
PGraphics array2;
void setup() {
size(200,200);
background(0);
array1 =…

Paweł Tokarz
- 326
- 2
- 15
1
vote
2 answers
Processing 2.0b8 / Disposing PGraphics objects and memory management
I'm working on a sketch that uses some PGraphics object as buffers that I draw on the screen with the image() method.
My problem is that I've noticed a huge memory leak, 99% due to this buffers not being destroyed properly.
Is there any way to get…

Sr.Richie
- 5,680
- 5
- 38
- 62
0
votes
1 answer
How can i resolve Runtime Error in Java Processing Application?
I have written an Java Processing application.
If I try to start it,
I get the following error:
""processing.core.PGraphics.createShape(int, float[])" because "this.g" is null".
My Application has a View, Controller and Modell.
They only interact…

Randy
- 1
- 1