We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › ControlP5 + SDrop
Page Index Toggle Pages: 1
ControlP5 + SDrop (Read 805 times)
ControlP5 + SDrop
Apr 18th, 2009, 2:18pm
 
I tried using SDrop to drag and drop an image into a sketch using ControlP5, and when I display the image, the labels and whatnot, were all out of place.

http://albums.kimag.es/albums/tacticalbread/20097177.png

is this an already known issue?

also, is there anything I can do about it?
Re: ControlP5 + SDrop
Reply #1 - Apr 22nd, 2009, 2:51am
 
i did a quick test combining example ControlP5basics and DropLoadImage, works fine for me. when dropping an image onto the display window, the image displays fine and controllers stay in their original location. anything special happening in your draw method?

andreas
Re: ControlP5 + SDrop
Reply #2 - Apr 24th, 2009, 1:19am
 
hmm, what would be something special?

all I'm really doing in the draw method is setting stroke, fill, and strokeWeight a few times, drawing a rectangle, calling movie.addFrame() if my recording boolean is true, and setting the value of an integer.

also, I just commented out my entire draw method, and that didn't fix it.

I'm fairly new to programming, so I have no idea what could be causing this.

here's my full source:
http://tacticalbread.net76.net/PROGRAMMING/processing/P5Paint/paintingP5.pde

edit:
now that I think about it, I didn't notice it doing this before when I had it load and display the image as soon as it was dropped onto the Window. I have it now so it loads the image upon it being dropped, then displays it when the user selects the 'Image' tool.
Re: ControlP5 + SDrop
Reply #3 - Apr 24th, 2009, 3:01am
 
ok, i identified the something special. labels in controlP5 are images, in your mousePressed method at case 9 your are setting the imageMode to CENTER, for controlP5 labels the imageMode should be CORNER, so you have to set the imageMode back to CORNER

Code:

case 9:
if(drag !=null && mouseButton == LEFT && !mouseOver()) {
     imageMode(CENTER);
     image(drag, mouseX, mouseY);
     imageMode(CORNER);
}

Re: ControlP5 + SDrop
Reply #4 - Apr 24th, 2009, 4:08am
 
yay, that fixed it. :D

viel dank!
Page Index Toggle Pages: 1