[comp.sys.amiga.tech] Text

cmcmanis%pepper@Sun.COM (Chuck McManis) (03/12/88)

In article <247@ritcv.UUCP> msl5864@ritcv.UUCP (Michael S. Leibow) writes:
>If I can't do that, is there any way to draw the characters into a bitmap
>(not visible) and extract the parts that I need from the bitmap into the
>windows RastPort?

Yes, and it works quite well. You initialize a RastPort and a BitMap 
structure, then use AllocRaster() to get some memory (it doesn't have
to be full size, just large enough to hold your text) and then render
your text into it. Something like ...
	/* Done from memory so don't quote me on it ... */
	InitRastPort(&rp);
	InitBitMap(&bm,20,20,1);
	bm.Planes[0] = AllocRaster(RASSIZE(20,20));
	rp.BitMap = &bm;
	MyFont = OpenDiskFont(SomeFontAttr);
	SetFont(rp,MyFont);
	Move(rp,0,rp->TxBaseline);
	Text(rp,"A",1);

You now have a mini bitmap with an "A" in it...


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.