Hey -

> I'm trying to horizontally mirror an image using copypixels. Might 
> this be possible using a reversed destination quad? I imagine so, but 
> I'm having some trouble deriving the quad given the rect of the image.

This should do what you want..

----------------------------------
-- given an image object, this method will flip the image object
-- either horizontally, vertically or both and will return the
-- new image object
-- 2002, Kendall Anderson - http://www.invisiblethreads.com

-- sFlipMode = #hor, #ver or #both

on _FlipImage me, iSrc, sFlipMode
  
  iFlip = iSrc.duplicate()
  
  dUL = point(0,0)
  dUR = point(iSrc.rect[3],0)
  dLR = point(iSrc.rect[3],iSrc.rect[4])
  dLL = point(0,iSrc.rect[4])
  
  if (sFlipMode = #hor) or (sFlipMode = #both) then 
    reverseQuad = [dUR, dUL, dLL, dLR]
    iFlip.copyPixels(iSrc,reverseQuad,iSrc.rect)
    iSrc = iFlip
  end if
  
  if (sFlipMode = #ver) or (sFlipMode = #both) then
    reverseQuad = [dLL, dLR, dUR, dUL]
    iFlip.copyPixels(iSrc,reverseQuad,iSrc.rect)
    iSrc = iFlip
  end if
  
  iFlip = void
  
  return iSrc
  
end 
----------------------------------

enjoy,

Kendall
[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