<p dir="ltr">"Multiple 50x50 images" sounds like you are trying to make a game.</p>
<div class="gmail_quote">On Apr 24, 2013 2:00 AM, "Laurent" <<a href="mailto:laurent.orseau@gmail.com">laurent.orseau@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>It works for me (Ubuntu), replacing your pictures with strings, although the placement is probably not what you'd expect: it is not top-left-position based and the margin depends on the previous elements.<br>
<br></div>You can put all the images inside a panel% instead of directly into the frame: all the containees are superimposed in a panel%, so the margins will work as you expect.<br><br>Or you can create horizontal panels containing vertical panels and just place the images one after the other in each vertical panel.<br>
<br>Or you can use a canvas% to display the images at specific locations, but this is a somewhat different approach.<br><br>Laurent<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 24, 2013 at 4:53 AM, Alan Johnsey <span dir="ltr"><<a href="mailto:a.johnsey@cox.net" target="_blank">a.johnsey@cox.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for this example. I'm trying to load multiple 50x50 ".bmp" images<br>
into a frame, specifying both the horizontal and vertical positions.<br>
Specifying the horiz-margin for a message works fine, but the vert-margin<br>
does not. Is this an error, or am I missing something? I'm using Racket 3.3.<br>
<br>
Sample code:<br>
<br>
#lang racket/gui<br>
(define xmax 12)<br>
(define ymax 10)<br>
<div><br>
(define f (new frame% [label "This Space For Rent"]<br>
</div> [height (* 50 ymax)]<br>
[width (* 50 xmax)]<br>
[alignment '(left top)]<br>
<div> ))<br>
<br>
(define l (new message% [parent f]<br>
</div> [vert-margin 0]<br>
[horiz-margin 0]<br>
[label (make-object bitmap% "x.bmp")]))<br>
<br>
<br>
(set! l (new message%<br>
[parent f]<br>
[vert-margin 0]<br>
[horiz-margin 50]<br>
[label (make-object bitmap% "y.bmp")]))<br>
<br>
(set! l (new message%<br>
[parent f]<br>
[vert-margin 50]<br>
[horiz-margin 0]<br>
[label (make-object bitmap% "z.bmp")]))<br>
<br>
<br>
(send f show #t)<br>
<div><div><br>
<br>
-----Original Message-----<br>
From: <a href="mailto:users-bounces@racket-lang.org" target="_blank">users-bounces@racket-lang.org</a> [mailto:<a href="mailto:users-bounces@racket-lang.org" target="_blank">users-bounces@racket-lang.org</a>]<br>
On Behalf Of Michael Wilber<br>
Sent: Tuesday, April 16, 2013 9:20 AM<br>
To: deepak verma; users<br>
Subject: Re: [racket] image on frame<br>
<br>
Try something like:<br>
<br>
#lang racket/gui<br>
(require racket/draw)<br>
(define f (new frame% [label "This Space For Rent"]))<br>
(define l (new message% [parent f]<br>
[label (make-object bitmap%<br>
"/tmp/130414_005.jpg")]))<br>
(send f show #t)<br>
<br>
deepak verma <<a href="mailto:deepakverma14021994@gmail.com" target="_blank">deepakverma14021994@gmail.com</a>> writes:<br>
> how can we show a image on frame ?<br>
> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br>
<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br></div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div>