![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| You won't lose points for doing the whole file path, but if you can't get getMediaPath to work, you should work at it. You really want it working before you get to homeworks 4 and 5. If you get an error that it isn't a file, you have the filename spelled wrong or you're missing the extension. What does it say when you print it? Mark Guzdial |
| 7x95 is the 7inch by 9.5 inch canvas. No, you don't have to fill the whole thing. As you get your collages, consider posting them in the Sp2003 HW3 Collages Mark Guzdial |
| For the person who can't get getMediaPath() to work – did you remember to setMediaFolder() first? Mark Guzdial |
| Yes, you can just use flowers if you want. But you're also encouraged to be creative and build cool things, too! Sure, you know how to turn a picture upside down – read the mirroring examples again! You can probably figure out how to go clockwise too. Mark Guzdial |
| Yes, but I encourage you to try to use your own pictures. It's not necessary, but you'll get more out of it that way. Mark Guzdial |
| writePictureTo(picture,"filename.jpg") Mark Guzdial |
| See above. This is also available in JES Help, and in lecture slides, and in the book. Mark Guzdial |
| If you write your collage function so that it returns the canvas when you're done, you can assign a name to the returned value (canvas = collage()). You can then write out the collage with writePictureTo(canvas,"mypicture.jpg"). If you're still getting errors, post the error. Mark Guzdial |
| What filename did you use? If you didn't specify a full path, it's in your JES (or jes-nc) directory. Mark Guzdial |
| Write it out, then double-click on it in Windows. You should be able to see it in IE or Netscape. Mark Guzdial |
| Entirely up to you. You'll notice that the two collages currently on the gallery do it differently: One has none touching, the other has lots of overlap. (Both are REALLY cool!) Mark Guzdial |
| Summer, read earlier on this page: Username attach password carmen. Look for the mediasources directory on your disk and you should find mycollage.jpg in there. Mark Guzdial |
| Not your normal one. Because you said "/mediasources/mycollage.jpg" then it's in the directory "mediasources" on your hard disk, not in your account – if that directory exists. If it didn't, then it may not have saved at all. Try just "mycollage.jpg" without the directory, then check your JES folder. Mark Guzdial |
| It should be in your JES directory. Mark Guzdial |
| None of which things? You could try doing a search for the file you created. In Windows, go to your Start menu and choose Search. On Macs, go to the Finder and find Search in the Edit menu (I think...I miss my Powerbook!). Mark Guzdial |
| Justin, check your targetX and targetY values – they're beyond the height and width of your picture. (We had this in lecture once, and I put print statements before that line, then saw the values when it stopped.) When you use your own pictures, you'll have to adjust the ranges to fit for the new pictures. Mark Guzdial |
| That's directly from your method? You're never calling collage() and you're never writing the picture out. When a function executes return, it's DONE – nothing else in the function executes! You need to do canvas=collage() and then the writePictureTo from the COMMAND area, not from your program. Mark Guzdial |
| Sarah, print sourceY and show(picture) on the line before to see what happens and what those values are. What error are you getting? Mark Guzdial |
| Do a show(canvas) before you write it, to make sure that the picture was generated. If nothing was generated, nothing will be written. Mark Guzdial |
| Try a path then. If you setMediaFolder(), then writePictureTo(canvas,getMediaPath("mycollage.jpg")) should put it in your MediaFolder Mark Guzdial |
| Is canvas a variable in your command area or in your function? Is collage? Try showing it first – if it doesn't show, it's not the right variable name. Mark Guzdial |
| No problem at all. Mark Guzdial |
| That means that canvas is not the name of the picture containing your collage. Try printing it or showing it. Are you returning the canvas from your function? Are you setting a name to it? Mark Guzdial |
| The error means that there is an error in your createCollage() where you're using the wrong variable name. Check the spelling. If you turn the Options mode to Expert, it will tell you the name of the variable that it can't figure out. What line is yellowed? That should be where the invalid name is. I don't know what it means that JES is shutting off after you try your programs? It quits? There is a function named sys.exit() that if you execute it, it will quit JES, but I can't imagine you doing that on accident. What exactly happens? Mark Guzdial |
| If you can't get it to save, one of the things that might be wrong is your path. If in doubt, just explicitly save it to C:\. Also, make sure that the picture you're trying to save is the right one: |
| Remember to change the name of your file to something unique before you upload to the gallery. If you name your collage "myCollage.jpg", and somebody else uses the same name and uploads, it will replace the original. All of a sudden, your collage right by your name will be replaced with the new one. Oh no! Adam Wilson |