[Newbies] how to create multiple colorforms from a master
Michael van der Gulik
mikevdg at gmail.com
Mon Mar 2 00:38:45 UTC 2009
On Mon, Mar 2, 2009 at 12:48 PM, mstramba <mikestramba at gmail.com> wrote:
> I have a ColorForm create from : (Form fromFileNamed: cards).
> It's an 840x504x8 png file of a deck of playing cards, i.e. showing all
> I want to create individual ColorForms, each representing one playing card
> from the 'master' colorform.
> So I guess I need to (in a loop) extract a rectangular area of pixels from
> the original ColorForm and then create a new colorform from those extracted
> I'm looking at the ColorForm, ImageMorph, Form .. and other superlcasses
> methods, but haven't figured out which combination of methods I need to
eachCard := masterForm copy: (0 at 0 corner: 840 at 504).
You'll need to replace 0 at 0 and 804 at 504 with the coordinates you need.
Also, this is fun:
(Display copy: (0 at 0 corner: 1024 at 768)) asMorph openInWindow
It makes a partial screen-shot :-).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners