>I seem to remember a post about converting members bitdepth using imaging
>lingo.
>
>Many Thanks
>Brad
Brad, you seems to remember right:
Sending it over again....
here is the second version of the SetMemberDepth handler, now with
support for palette, dither and all other built-in copyPixels options:
------ ver 1.0 Yariv Alter Fin / Marcel van der Drift ------
on SetMemberDepth mem,dep,opts
if opts.ilk=#integer then opts=[#dither:opts]
if opts.ilk=#proplist then pal=symbol(getaprop(opts,#palette))
else pal=symbol(opts)
targ=image(mem.width,mem.height,dep,pal)
targ.copyPixels(mem.image,mem.rect,mem.rect,opts)
mem.image=targ
return targ
end
------ www.nobodyHere.com / www.alterFin.com ------
opts can be a proplist with palette/dither/bgcolor and such, a string
or symbol for the palette or an integer for the dither code:
SetMemberDepth member("myMem"),2
SetMemberDepth member("theirMem"),4,"Grayscale"
SetMemberDepth
member("yourMem"),8,[#bgcolor:rgb(255,0,0),#dither:true,#palette:"rainbow"]
img=SetMemberDepth member("roysMem"),16,1215...
sending strange values for the object palette or copy options does
not seems to cause any problems.
the handler is now also a function returning the new image object.
this might speed up further operations with the object, yet beware:
"This operation cannot be undone."
btw, anyone prepared for writing a loop to run with the dither value
of a copyPixels command from 1 to the maxinteger, getting pixel
changes in sample areas and returning some more of these secret
'dither eggs' ....?
thanks again Roy,
enjoy all,
Yariv Alter Fin / Marcel van der Drift
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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!]