We are about to switch to a new forum software. Until then we have removed the registration on this forum.
How can I resize a video in processing and how do I make the video transparent? I got the video into the sketch but it is too big too fit the sketch when it is run and it is not transparent enough.Any help would be greatly appreciated thank you!!Here is my code:
import processing.video.*; Movie myMovie; PFont f; import oscP5.*; import netP5.*;
public float engBor = 0; // Engaged/Bored public float exc = 0; // Excitement public float excLon = 0; // Excitement Long Term public float med = 0; // Meditation public float fru = 0; // Frustration
OscP5 oscP5;
void setup() {
myMovie=new Movie(this,"Bruh.mp4"); myMovie.loop();
size(960, 720); frame.removeNotify(); frame.setUndecorated(true); frame.addNotify();
f = loadFont( "ArialMT-36.vlw" );
frameRate(30); smooth();
/* start oscP5, listening for incoming messages on port 7400 make sure this matches the port in Mind Your OSCs */ oscP5 = new OscP5(this, 7400);
// plug the OSC messages for the Affectiv values oscP5.plug(this, "updateEngBor", "/AFF/Engaged/Bored"); oscP5.plug(this, "updateExc", "/AFF/Excitement"); oscP5.plug(this, "updateExcLon", "/AFF/Excitement Long Term"); oscP5.plug(this, "updateMed", "/AFF/Meditation"); oscP5.plug(this, "updateFru", "/AFF/Frustration"); }
void draw() { image(myMovie,100,100);
textFont(f, 15); stroke(0, 255, 0); fill(255, 255, 0);
text ( "Engaged/Bored", 110, 200); fill(150, 255, 150); text ( "Excited", 295, 200); fill(255, 0, 200); text ( "Confused", 450, 200); fill(255, 100, 155); text ( "Relaxed", 610, 200); fill(255, 255, 255); text ( "Frustrated", 765, 200);
fill(0, 10); rectMode(CORNER); rect(0, 0, width, height);
drawCircle(engBor, 1); // circle 1: Engaged/Bored
drawCircle(exc, 2); // circle 2: Excitement drawCircle(excLon, 3); // circle 3: Excitement Long Term drawCircle(med, 4); // circle 4: Meditation drawCircle(fru, 5); // circle 5: Frustration
}
void drawCircle(float affVal, int circleNo) { fill(100, 100, 255, 5); strokeWeight(4);
ellipseMode(CENTER); stroke(255, 0, 0); float diam = map(affVal, 0, 1, 1, width/5); ellipse((width/6)*circleNo, height/2, diam, diam); }
public void updateEngBor(float theValue) { engBor = theValue; }
public void updateExc(float theValue) { exc = theValue; }
public void updateExcLon(float theValue) { excLon = theValue; }
public void updateMed(float theValue) { med = theValue; }
public void updateFru(float theValue) { fru = theValue; }
void movieEvent(Movie m) { m.read(); }
Answers
http://forum.processing.org/two/discussion/8045/how-to-format-code-and-text