Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+10 votes
asked in CSC 150 January201920 by (1 point)

1 Answer

+5 votes
 
Best answer

What do you want to use it for? (It can do a lot of things, although some of them are hard...)

Here's a simple example:

extensions [ bitmap ]

to setup
  ;; import a large photo and store it in the image variable
  let image bitmap:import "elephant.jpg"    

  ;; show the image (or whatever fits of it) in the view, at pixel coordinates 0,0
  ;; (Note, pixel coordinates are not the same as patch/turtle coordinates...)
  bitmap:copy-to-drawing image 0 0

  ;; make a smaller 200x200 pixel version of the elephant
  let small-image bitmap:scaled image 200 200  

  ;; display that smaller image in the view at pixel coordinates (50, 100)
  ;; (Note, pixel coordinates are not the same as patch/turtle coordinates...)
  bitmap:copy-to-drawing small-image 50 100
end
answered by (3.5k points)
selected by
...