Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!oliveb!felix!dhw68k!thecloud
From: thecloud@dhw68k.cts.com (Ken McLeod)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Bitmap --> region code needed
Message-ID: <26745@dhw68k.cts.com>
Date: 28 Sep 89 12:33:35 GMT
References: <8909261258.AA01237@cscwam.UMD.EDU>
Reply-To: thecloud@dhw68k.cts.com (Ken McLeod)
Distribution: usa
Organization: Wolfskill & Dowling residence; Anaheim, CA (USA)
Lines: 29

In article <8909261258.AA01237@cscwam.UMD.EDU> rick@wam.UMD.EDU writes:
>I hope someone can point me in the right direction.  I'm looking for code
>(C, asm, or Pascal) that will convert a bitmap into a region (ie black pixels
>included in region or vice versa for white pixels).
>Public domain source would be nice but commercial source will also do.

  MacTutor had an article on this about 3 or 4 months back (sorry, don't
know the exact issue... I haven't tried to keep up :-(  As I recall, the
core routine was written in MPW assembly, with usage examples in Pascal.

  Another solution might be to run 32-Bit QuickDraw (assuming you have the
appropriate hardware). The legendary DTS BitMapRgn routine ("Licensed
to Fill") has been implemented in 32-Bit QD... at least, that's the
impression given by the new MPW interfaces. And I quote:

FUNCTION BitmapToRegion(region:RgnHandle; bMap:BitMap): OSErr;
	INLINE $A8D7;

pascal OSErr BitmapToRegion(RgnHandle region, BitMap *bMap)
	= {0xA8D7};


(If this isn't the same routine, I'm sure someone will gently correct me :-)
Hope this helps...
-- 
==========     .......     =============================================
Ken McLeod    :.     .:    UUCP: ...{spsd,zardoz,felix}!dhw68k!thecloud
==========   :::.. ..:::   INTERNET: thecloud@dhw68k.cts.com
                ////       =============================================