Discussion:
Image size
F. Medeiros
2014-07-09 09:49:00 UTC
Permalink
Hello again,

Sorry to bother, I have been interested in shoebot for quite some time
but now I have finally a project where I can use it. I am still very
noob, please tell me if this is not the place for these questions.

The following code gives me an image that is 125x125 pixels. Shouldn't
it be 100x100?

size(100,100)
colorrange(255)
colormode(HSB)

stp = 10

for y in range(0, HEIGHT/stp, 1):
for x in range(0, WIDTH/stp, 1):
fill(240, random(130, 255), random(0, 162))
rect(x*stp, y*stp, stp, stp)

Thank you.

F. Medeiros.
Stuart Axon
2014-07-09 10:32:17 UTC
Permalink
Interesting !

SVG is Vector based, I'm not 100% sure what happens wrt the scaling, but it could be this:
'Re: [cairo] SVG output without "pt" in the coordinates - how?' - MARC

 
         
'Re: [cairo] SVG output without "pt" in the coordinates - how?' - MARC
[prev in list] [next in list] [prev in thread] [next in thread] List: cairo
Subject: Re: [cairo] SVG output without "pt" in the coordinates - how?
From: askok () dnainternet ! net
Date: 2008-10-25 8:40:12
Message-ID: web-11636700 () kuikka ! dnainternet ! ne...
View on marc.info Preview by Yahoo
 
 
 
Of course, because SVG is Vector based you can scale it how you want afterwards, losslessly.


If you output to PNG, a raster format then the image is 100x100, exactly as you would expect.

S++
Post by F. Medeiros
Hello again,
Sorry to bother, I have been interested in shoebot for quite some time
but now I have finally a project where I can use it. I am still very
noob, please tell me if this is not the place for these questions.
The following code gives me an image that is 125x125 pixels. Shouldn't
it be 100x100?
size(100,100)
colorrange(255)
colormode(HSB)
stp = 10
        fill(240, random(130, 255), random(0, 162))
        rect(x*stp, y*stp, stp, stp)
Thank you.
F.  Medeiros.
_______________________________________________
Shoebot-devel mailing list
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
Loading...