Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
wasinmike
wasinmike's Profile
1
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Need help "X-Ray" image
[1 Reply]
27-Apr-2011 11:48 AM
Forum:
Programming Questions
Hey guys I am new to processing and have discovered some really cool things with it.
I am currently trying to do a piece similar to an "X-Ray" - see the underlying image.
The only problem is my underlying image is not sized properly and I am having trouble what settings I need to change
to resize it properly.
Any help would be greatly appreciated, thanks!
public static int SQUARE_WIDTH = 100;
public static int SQUARE_HEIGHT = 100;
//This is to tell the system that there is a box to be formed for the X-ray
//(Help: I am trying to turn into a faded circle but just changing SQUARE is not helping me.)
PImage world_trade_center, WTC2, T2, T1, PHEnd;
//This is to tell what images are used in the project
void setup() {
size(750,500); //Size of course
world_trade_center = loadImage("world_trade_center.jpg");
WTC2 = loadImage("WTC2.jpg");
T2 = loadImage("T2.jpg");
T1 = loadImage("T1.jpg");
PHEnd = loadImage("PHEnd.jpg");
//Used to load the images into the program to use during void draw
}
void draw() {
image(world_trade_center, 0, 0, width, height); //This is the foreground image (really the background), but "X-Ray" makes it seem foreground.
//copy (WTC2, 50, mouseY, width, 133, 50, mouseY, height,133);
copy(WTC2,
constrain(mouseX-SQUARE_WIDTH/2,0,width),
constrain(mouseY-SQUARE_HEIGHT/2,0,height),
SQUARE_WIDTH,SQUARE_HEIGHT,
constrain(mouseX-SQUARE_WIDTH/2,0,width),
constrain(mouseY-SQUARE_HEIGHT/2,0,height),
SQUARE_WIDTH, SQUARE_HEIGHT);
«Prev
Next »
Moderate user : wasinmike
Forum