Questions tagged [pict]

Standard image format in Racket.

The pict library is one of the standard Racket functional picture libraries.

It supports both vector and bitmap images.

13 questions
5
votes
3 answers

How to use GraphViz and Racket

Is it possible to use the graphviz module to draw graphs in a racket frame (GUI)? If it's possible, would anyone a tutorial that shows how to use? Thank's
chsms
  • 107
  • 2
4
votes
1 answer

Racket - export Pict to Image File

How would I go about exporting a Racket pict as an image file I can use on a web page? (any html-capable format or data-uri would do)
Arjun
  • 1,701
  • 4
  • 17
  • 25
3
votes
2 answers

Visualize arbitrary tree in Racket using tree-layout

How to visualise arbitrary tree? for example: (define T1 '(and (or x1 x2)(or x3 x4 x5))) or one generated with: (define functions '(not if and or)) (define terminals '(A0 A1 A2 D0 D1)) (define functions&terminals (append terminals functions…
X10D
  • 600
  • 2
  • 13
3
votes
2 answers

hb-append vs hbl-append and ht-append vs htl-append in pict

Racket's pict, has several combinators for combining other pictures. These docs contain a nice table for how its *-append combinators work: Most of these examples make sense. The first letter is v or h for vertical and horizontal respectively. The…
Leif Andersen
  • 21,580
  • 20
  • 67
  • 100
3
votes
1 answer

Racket and 2htdp/image in the terminal

I don't know how to display images in the terminal. Here is a .rkt test script: #lang racket (require 2htdp/image) (circle 10 "solid" "red") Then, I do this in the terminal: $ racket Welcome to Racket v6.8. > (enter! "test.rkt") (object:image%…
Albert Han
  • 109
  • 1
  • 2
  • 9
3
votes
1 answer

How can I wrap text around an Image in a Scheme Slideshow?

I'm trying to code a slideshow using Racket, and I want most of my images to be on the right hand side of my text. So far I have the image where i want it, but all text afterwards ends up under the image to the left. I cant seem to get the text to…
2
votes
1 answer

racket/draw: get list of font face names?

Is it possible to get a list of available font face names in Racket? I want all values of x such that (text "Kimkoh" x) returns a pict with a unique font face.
Ben Greenman
  • 1,945
  • 12
  • 22
2
votes
1 answer

racket: pict to bytes (pixels)

How can I turn a pict into a byte string of the pixels in it? (I mean, a byte string of the pixels that would be in the bitmap you'd get from rendering the pict) This function works: #lang racket/base (require pict racket/class) (define…
Ben Greenman
  • 1,945
  • 12
  • 22
1
vote
1 answer

Painter example in SICP

The "Painter" example from SICP 2.2.4 is pretty interesting, and gives ways to create nice Escher-like paintings. For example, a recursive right-split procedure can be done something like: (define (right-split painter n) (if (= n 0) painter …
learn-sicp
  • 69
  • 4
1
vote
1 answer

Racket Slideshow 2Htdp Pict

I am trying to try and create an image using racket. I want to try and make a waffle but I can't seem to figure it out. This is my code: #lang slideshow (require 2htdp/image) (define (waffle img) (define two-p (hc-append img (rectangle 10 10…
Connie
  • 251
  • 4
  • 17
1
vote
1 answer

How to draw a picture in web app using Racket?

I'm looking for a way of drawing a pictures in my simple web-app. Basically I'm trying to submit a picture of circle using standard slideshow library, but it doesn't work and I have no idea why. Here is a sample: #lang web-server/insta (require…
Dimitry
  • 11
  • 3
1
vote
2 answers

Draw an arrow in racket

How to draw an arrow in a frame in racket (DrRacket)? For example between two objects: a circle and a rectangle obtained by: (send dc draw-ellipse 50 50 30 30) and (send dc draw-rectangle 200 200 30 6)
chsms
  • 107
  • 2
0
votes
1 answer

How to design a Button with an icon or pict in Racket?

I want to do Buttons and so to look nicer when doing windowing in Dr Racket. I did not found an example how to do it and where are icons stored. Isabel
jdabel
  • 11
  • 1
  • 1