PImage frame, temp; void setup() { /*Display your frame here*/ frame = get(); // this will capture the screen } void movieEvent(Movie m) { m.read(); frame.copy(m, 0, 0, m.width, m.height, Xbluestart, Ybluestart, Xblueend, Yblueend); } void draw() { Image(frame, 0, 0); }
/** * Unsafe do not use unless you are sure. This will be moved to a utility * class. */ public static PImage getImageFrom(PVector coord, PImage src, PImage dst, int radius) { int x = (int) coord.x; int y = (int) coord.y; dst.copy(src, x - radius / 2, y - radius / 2, radius, radius, 0, 0, radius, radius); return dst; }
protected PImage getTintedGlyphImage(PFont.Glyph glyph, int tintColor) { if (textFontInfo.tintCache == null) { textFontInfo.tintCache = new LinkedHashMap<Integer, PImage[]>(16, 0.75f, true) { @Override protected boolean removeEldestEntry(Map.Entry<Integer, PImage[]> eldest) { return size() > FontInfo.MAX_CACHED_COLORS_PER_FONT; } }; } PImage[] tintedGlyphs = textFontInfo.tintCache.get(tintColor); int index = glyph.index; if (tintedGlyphs == null || tintedGlyphs.length <= index) { PImage[] newArray = new PImage[textFont.getGlyphCount()]; if (tintedGlyphs != null) { System.arraycopy(tintedGlyphs, 0, newArray, 0, tintedGlyphs.length); } tintedGlyphs = newArray; textFontInfo.tintCache.put(tintColor, tintedGlyphs); } PImage tintedGlyph = tintedGlyphs[index]; if (tintedGlyph == null) { tintedGlyph = glyph.image.copy(); tintedGlyphs[index] = tintedGlyph; } return tintedGlyph; }