twodotone
YaBB Newbies
Offline
Posts: 5
Re: lingo user having some problems with images
Reply #8 - Jul 23rd , 2005, 4:17pm
hey, mark. sorry for the delay. I was on a deadline and had a pretty hard time to even check emails. last night (tired as hell) I checked the board and found your post. immediately gave it a try. no big change. here's what I have so far PGraphics3 bfr; PImage extImg; color blk=color(0,0,0); void setup() { size(200, 200); framerate(30); bfr=new PGraphics3(320,240,null); extImg=loadImage("test.gif"); background(127,255,121); stroke(255,0,0,100); bfr.stroke(255,0,0,255); bfr.background(127,255,121); bfr.set(10,10,blk); bfr.set(100,10,blk); bfr.set(100,100,blk); bfr.set(10,100,blk); //bfr.image(extImg,0,0); } void draw() { int mx=mouseX; int my=mouseY; bfr.line(200,200,mx,my); //copy(bfr,0,0,width,height,0,0,width,height); line(0,0,mx,my); } check the commented lines, please. if we uncomment the first one (in the setup) we can have a graphic on bfr. but then, when executing a line over it bfr.line(200,200,mx,my); we get a weird result. if you try staying still on the image, then you realize that the line is drawn cycle by cycle. this means that we have a low opacity (alpha) on the stroke. setting a different stroke, doesn't change much. if we uncomment the second commented line copy(bfr,0,0,width,height,0,0,width,height); then we can't see any result, cause the line is drawn with low opacity, but at the next cycle it's covered by the bfr base image again. this means that fixes are needed on the stroke method over PGraphics3 objects. by the way... thanx a lot for you efforts, mark. :)