At 3:06 PM +0200 9/23/02, you wrote:
>Hi
>
>little question.
>
>I have a foto on the background. On top I want to have a layer that 
>contains a transparant square. The effect I want to create is that 
>the photo is blurred there where the square is on top of the photo. 
>the rest of the image remains sharp.
>
>How do I do this effect? Is there an xtra for this?
>
>Thx
>Tom

I'd create a blurry version of the original & just display a crop of 
it as the rectangle you describe

here's a routine that takes an image + an amount & returns a blurred version

on blurImage sourceImage, amt
   tIL = sourceImage.duplicate()
   newI = sourceImage.duplicate()
   if amt = VOID then amt = 1
   vals = [[-amt,-amt], [amt, -amt], [amt, amt], [-amt, amt]]
   repeat with i = 1 to 4
     g = vals[i]
     offset = rect(g[1], g[2], g[1], g[2])
     bAmt = 100/(1+i)
     newI.copyPixels(tIL, tIL.rect + offset, newI.rect, [#blend : bAmt])
   end repeat
   tIL = VOID
   return newI
end

-- for your application, determine the crop rect by using the rect of 
the overlay relative to the rect of the sharp image (background) & 
then use it to crop the returned blurred image & load the little rect.

-- sprite(sharp) = the sharp background
-- sprite(blur) = the blurry overlay

cropLeft = sprite(blur).rect.left - sprite(sharp).rect.left
cropTop = sprite(blur).rect.top - sprite(sharp).rect.top
cropRect = rect ( cropLeft, cropTop, \
       (cropLeft + sprite(blur).width), (cropTop + sprite(blur).height) )

blurryImage = blurImage(sprite(sharp).member.image, 1)
sprite(blur).member.image = blurryImage.crop(cropRect)

note: the amt is the density of the blur - to get a lot of blurring, 
it's best to call the routine again with a small number ...

hth

-Buzz

-- 
         Buzz Kettles
[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