At 13:28 Uhr -0400 21.08.2003, Colin Holgate wrote:
maybe it is a matter of my english skills, but that's exactly what I didn't understand in your first post, because I don't believe, that you just want to draw a 'matte' solid circle to the stage, like:


on getMatteCircle radius, color


The main difference between your routine and what I was trying is that I wanted to use the draw function, and you're using the fill function. I did think about using fill, because it will do for what I want, but I was still curious about whether it's possible to do the same thing using draw.

it should work the same with draw, but draw would only draw the outline of the crcle, with the linesize you specify (or 1, if nothing specified for #linesize)
the only problem is that draw is veeery slow at times on the mac.
if yor image object is < 128 pixels in one of its dimensions and the colordepth is 8
and for colordepth <8 it becomes REALLY slow no matter which size the image object is.


I pasted a handler which shows this (this is a mac only issue BTW)
(maybe you remember this thread from another list ?)
so working around draw() is most of the times faster, no matter how you work around it...



speedtest 8
-- "draw 8 pixel line on 127 pixel 8 -bit image:"
-- 257
-- "draw 8 pixel line on 128 pixel 8 -bit image:"
-- 17
-- "fill 8 pixel line on 127 pixel 8 -bit image:"
-- 2
-- "fill 8 pixel line on 128 pixel 8 -bit image:"
-- 2
-- "draw 8 pixel line on 127 pixel 32 -bit image and afterwardscopyPixeling to an 8 bit #grayscale image."
-- 100



speedtest 16
-- "draw 8 pixel line on 127 pixel 16 -bit image:"
-- 30
-- "draw 8 pixel line on 128 pixel 16 -bit image:"
-- 7
-- "fill 8 pixel line on 127 pixel 16 -bit image:"
-- 2
-- "fill 8 pixel line on 128 pixel 16 -bit image:"
-- 2
-- "draw 8 pixel line on 127 pixel 32 -bit image and afterwardscopyPixeling to an 8 bit #grayscale image."
-- 103


speedtest 4
-- "draw 8 pixel line on 127 pixel 4 -bit image:"
-- 421
-- "draw 8 pixel line on 128 pixel 4 -bit image:"
-- 420
-- "fill 8 pixel line on 127 pixel 4 -bit image:"
-- 2
-- "fill 8 pixel line on 128 pixel 4 -bit image:"
-- 2
-- "draw 8 pixel line on 127 pixel 32 -bit image and afterwardscopyPixeling to an 8 bit #grayscale image."
-- 111



-- copy this handler and run 'speedtest <integer>' in the message window


on speedtest theDepth
  if voidP(theDepth) then theDepth = 8

  put "draw 8 pixel line on 127 pixel "\
&theDepth&" -bit image:"

  r = rect(10, 10, 18, 11)
  i = image(127, 127, theDepth)

  z = the milliseconds
  repeat with n = 1 to 100
    i.draw(r, [#shapetype:#line, #color:rgb(0,0,0)])
  end repeat
  put the milliseconds - z

  put "draw 8 pixel line on 128 pixel "\
&theDepth&" -bit image:"

  r = rect(10, 10, 18, 11)
  i = image(128, 128, theDepth)

  z = the milliseconds
  repeat with n = 1 to 100
    i.draw(r, [#shapetype:#line, #color:rgb(0,0,0)])
  end repeat
  put the milliseconds - z

  put "fill 8 pixel line on 127 pixel "\
&theDepth&" -bit image:"

  r = rect(10, 10, 18, 11)
  i = image(127, 127, theDepth)

  z = the milliseconds
  repeat with n = 1 to 100
    i.fill(r, rgb(0,0,0))
  end repeat
  put the milliseconds - z

  put "fill 8 pixel line on 128 pixel "\
&theDepth&" -bit image:"

  r = rect(10, 10, 18, 11)
  i = image(128, 128, theDepth)

  z = the milliseconds
  repeat with n = 1 to 100
    i.fill(r, rgb(0,0,0))
  end repeat
  put the milliseconds - z


theDepth = 32 put "draw 8 pixel line on 127 pixel "\ &theDepth&" -bit image and afterwards\ copyPixeling to an 8 bit #grayscale image."

  r = rect(10, 10, 18, 11)
  i = image(127, 127, theDepth)
  i2 = image(127, 127, 8, 0, #grayscale)

  z = the milliseconds
  repeat with n = 1 to 100
    i.draw(r, rgb(0,0,0))
    i2.copyPixels(i, i.rect, i.rect)
  end repeat
  put the milliseconds - z

end
--

  |||
ażex
 --
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to