d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Javascript Question
Add Reply New Topic New Poll
Member
Posts: 1,781
Joined: Mar 16 2007
Gold: 0.00
Apr 17 2013 10:53am
public class ChromakeyApp extends Picture
{
public static void main(String[]a)
{
FileChooser.pickMediaPath();
Picture pOrigRef = new Picture( FileChooser.pickAFile() );
KeyablePicture pKPRef = new KeyablePicture(pOrigRef);
pKPRef.explore();
Picture bg = new Picture(FileChooser.pickAFile());
Picture r = new Picture(FileChooser.pickAFile());
pKPRef.chromakey2(bg,r);
pKPRef.explore();
Picture bgg = new Picture(FileChooser.pickAFile());
Picture rr = new Picture(FileChooser.pickAFile());
pKPRef.chromakey2(bgg,rr);
pKPRef.explore();
}

}
The first explore call shows an original picture that i choose. the chromakey2 method tells java to replace pixels of a certain color, and so i choose 2 more picture files to replace 2 different colors of pixels(basically the background) and that works fine. the last 4 lines though, instead of bringing up a picture with a different background that i select, it brings up the same picture as chromakey2(bg, r). how do i get it to show the different background that i chose?

this may be unclear, im not very good at this lol.
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Apr 17 2013 11:12am
first, that doesnt look like javascript
second, what is the package for Picture? I'm not familiar with it. is it part of the standard jdk?

This post was edited by carteblanche on Apr 17 2013 11:13am
Member
Posts: 83
Joined: Feb 27 2012
Gold: 0.00
Apr 18 2013 11:57pm
java != javascript
Member
Posts: 2,478
Joined: Jan 4 2007
Gold: 7,545.00
Apr 19 2013 06:38am
also, use the code block tags next time...
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll