For Programmers: Free Programming Magazines  


Home > Archive > Scheme > December 2004 > Displaying graphics in scheme









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Displaying graphics in scheme
Ma

2004-12-07, 4:19 am

Could anyone tell me how to display a picture file on my local hard
disk into scheme-graphics? For example, those .gif pictures in SICP
section 2.4

http://mitpress.mit.edu/sicp/full-t...tml#%_sec_2.2.4
Thanks a lot!

Jens Axel Søgaard

2004-12-07, 4:19 am

Ma wrote:

> Could anyone tell me how to display a picture file on my local hard
> disk into scheme-graphics? For example, those .gif pictures in SICP
> section 2.4
>=20
> http://mitpress.mit.edu/sicp/full-t...tml#%_sec_2.2.=

4

A recipe for DrScheme:

<http://schemecookbook.org/Cookbook/...eractionWindow=
>


--=20
Jens Axel S=F8gaard

Jens Axel Søgaard

2004-12-07, 4:19 am

Ma wrote:

> Could anyone tell me how to display a picture file on my local hard
> disk into scheme-graphics? For example, those .gif pictures in SICP
> section 2.4
>=20
> http://mitpress.mit.edu/sicp/full-t...tml#%_sec_2.2.=

4
> Thanks a lot!
>=20


See also Sperber's implementation of SICP's picture language for DrScheme=
:

<http://www-pu.informatik.uni-tuebin...r/software/ind=
ex.html>

--=20
Jens Axel S=F8gaard

Ma

2004-12-07, 4:19 am

This would be nice, but I'm using MIT Scheme 7.7.1 under Windows XP.

Have you any straightforward way to implement graphics display on this
software?
Jens Axel S=F8gaard wrote:
> Ma wrote:
>
http://mitpress.mit.edu/sicp/full-t...tml#%_sec_2.2.4[color=darkred]
>
> See also Sperber's implementation of SICP's picture language for

DrScheme:
>
>

<http://www-pu.informatik.uni-tuebin...ware/index.htm=
l>
>=20
> --=20
> Jens Axel S=F8gaard


Ma

2004-12-07, 9:05 am

Thanks! I'm enjoying DrScheme. But the language support seems to be
quite different from MIT scheme... I seem unable to run the programs I
wrote previously. Can you help me out?

Jens Axel Søgaard

2004-12-07, 4:04 pm

Ma wrote:

> Thanks! I'm enjoying DrScheme. But the language support seems to be
> quite different from MIT scheme... I seem unable to run the programs I
> wrote previously. Can you help me out?


Hi Ma,

DrScheme supports several versions of Scheme. If you follow SICP then
choose in the menu "Language" the menu item "Choose Language", fold out t=
he
blue triangle before PLT and choose the language "Pretty Big".

To install the SICP picture language follow the instructions below:

00:00:00 --- log: started scheme/04.09.05

07:58:14 <soegaard> You were asking about the picture language in SICP, r=
ight?
07:58:38 <jim> soegaard: yes
07:58:58 <soegaard> Mike Sperber implemented it for PLT Scheme.
07:59:18 <jim> :)

07:59:45 <soegaard> In DrScheme go to the file menu, and choose "Install =
=2Eplt file"
08:00:07 <soegaard> Then enter
08:00:08 <soegaard> http://www-pu.informatik.uni-tuebingen.de/users/sperb=
er/software/picture.plt

08:06:33 <soegaard> jim: I am looking for documentation to start it, it m=
ust be there somewhere

08:13:45 <soegaard> ah!
08:14:22 <soegaard> jim: In the "Language" menu choose "Add TeachPack".
08:15:24 <soegaard> jim: Then choose the file picture.ss hidden in the Te=
achPack directory (on my machine: C:/documents=20
and settings/js/Application Date/PLT 208.1/teachpack/picture.ss
08:15:38 <soegaard> jim: Press "Go"
08:15:56 <soegaard> jim: Then try: (paint (corner-split einstein 1))
08:16:30 <jim> soegaard: trying to find the teachpack (I installed the fi=
le as root in linux)

08:31:19 <soegaard> jim: And (paint (corner-split einstein 1)) works?
08:32:51 <jim> we're getting there. it knows paint but not corner-split
08:33:19 <jim> hah! it works
08:33:28 <soegaard> jim: ah! I loaded one of the example files first
08:33:32 <jim> (paint einstein)
08:34:08 <soegaard> jim: I loaded example.scm first and corner-split is d=
efined there.
08:34:50 <jim> are there stick figures?

08:36:01 <soegaard> jim: Open the file collects/painters.ss and see all t=
he provided procedures.
08:36:14 <jim> ahh
08:36:21 <soegaard> jim: There is a segments->painter which can be used t=
o make stick figures.
08:37:45 <jim> soegaard: ok, good enough... now how can I make the image =
larger?
08:38:00 <soegaard> use paint-hi-res
08:39:41 <jim> soegaard: -very- good :) thank you very much :)
08:39:51 <soegaard> no problem

--=20
Jens Axel S=F8gaard

Ma

2004-12-07, 4:04 pm

Thanks a lot! It's nice to see the solutions to 8-queen problem
displayed in a nice format on this DrScheme. But it still seems to have
less pre-defined functions from MIT Scheme. For example, (square
number) works on the latter but not the former.
This doesn't matter much any way...

Thant Tessman

2004-12-08, 3:59 pm

Ma wrote:

> Thanks! I'm enjoying DrScheme. But the language support seems to be
> quite different from MIT scheme... I seem unable to run the programs I
> wrote previously. Can you help me out?


How one displays graphics on a computer depends on the hardware, the
operating system, and the graphics API provided by that operating system
for that hardware. This graphics API is--as a rule--never Scheme. It's
usually C.

Consequently, there is no guarantee of a pre-manufactured solution to
your problem. Your choice is to either take advantage of someone else's
solution (which will always be tied to a specific Scheme implementation
on a specific platform), or build your own (which will likewise be tied
to a specific Scheme implementation on a specific platform). If you're
lucky, your chosen Scheme implementation will have been ported to more
than one platform *and* provide a platform-independent graphics API. I
have no experience with it, but I think DrScheme is just such an
implementation.

-thant
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com