Am 14.04.2006 um 12:42 schrieb <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>:

Hi,

I’m trying to do this pop-art effect thing… sof ar i’ve got it working up to the point that is makes a bunch of squares. I’m using copypixels with a source rect of 1 pixel and a larger destination, spaced at a regular interval… This is fine and dandy, but I’d like to do an assortiment of shapes in stead… I’m thinking a dynamically generated copypixels mask, but my image keeps turning up black…


make sure that the mask is 8-bit grayscale.

if I understood correctly you want something like:



shape = member("8bitshape").image.duplicate()
img = member("sourceImage").image.duplicate()

new(#bitmap).image = createPopArt(img, shape)


---------------------------------
on createPopArt img, shape

  r = shape.rect
  p = point(r.width/2, r.height/2)
  hoffs = point(r.width, 0)
  w = (img.width / r.width) + 1
  h = (img.height / r.height) + 1
  i = image(r.width, r.height, 32, 0)
  returnImg = image(img.width, img.height, 32, 0)

  repeat with n = 1 to h
    repeat with m = 1 to w
      i.fill(i.rect, img.getPixel(p))
      p = p + hoffs
      returnImg.copyPixels(i, r, i.rect, [#maskImage:shape])
      r = r.offset(r.width, 0)
    end repeat
    p = point(r.width/2, p[2] + r.height)
    r = r.offset(r.left * -1, r.height)
  end repeat

  return returnImg
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