Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!kth!draken!tut!santra!kampi!jmunkki From: jmunkki@kampi.hut.fi (Juri Munkki) Newsgroups: comp.sys.mac.programmer Subject: Re: Bitmap to region conversion Message-ID: <21400@santra.UUCP> Date: 20 Apr 89 23:10:39 GMT References: <8904181853.AA00466@vs08csc.UMD.EDU> <21369@santra.UUCP> Sender: news@santra.UUCP Reply-To: jmunkki@kampi.hut.fi (Juri Munkki) Organization: Helsinki University of Technology, Finland Lines: 33 In article <21369@santra.UUCP> jmunkki@kampi.hut.fi (Juri Munkki) writes: >In article <8904181853.AA00466@vs08csc.UMD.EDU> russotto@wam.UMD.EDU writes: >>I've heard that there is a routine available for converting >>bitmaps to regions (for use in DragGrayRgn for example) > >I decided that we needed a better answer. It took me two hours to write >a program that does the conversion on an aribitrary bitmap. I wrote it >in LSC and it is totally unoptimized (with calls like BitTst), but it >seems to work. It is under 200 lines in size (it also contains a test >program & code that draws a picture into a bitmap). I have already gotten a few requests for it, so I'm making available by anonymous ftp from vega.hut.fi (128.214.3.82). There are two files: pub/mac/finnish/bitrgn.c Source code (Think C) pub/mac/finnish/bitrgn.rsrc.bin Test resources (ResEdit) Please note that the resource file in in MacBinary format. You have to set the binary mode to transfer it correctly. Unless someone objects, I will post it here when a few people have confirmed that it really works and that they find it useful. If you do not have ftp access, wait for the posting or tell me (mail) that you would like to see it posted. Since the region data structure is not public, I would like someone from Apple to read it before everybody starts using it. The source code doesn't really document the region data structure well enough for anyone to understand it. I might write a description, if I find the time. _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ | Juri Munkki jmunkki@hut.fi jmunkki@fingate.bitnet I Want Ne | | Helsinki University of Technology Computing Centre My Own XT | ^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^