Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!apple!dlyons From: dlyons@Apple.COM (David Lyons) Newsgroups: comp.sys.apple Subject: Re: custom icons question again Message-ID: <32246@apple.Apple.COM> Date: 5 Jun 89 07:49:55 GMT References: <9175@boulder.Colorado.EDU> Organization: Apple Computer Inc, Cupertino, CA Lines: 41 In article <9175@boulder.Colorado.EDU> hartkopf@tramp.Colorado.EDU (HARTKOPF JEFFREY M) writes: >Thanks, Dave Lyons, for the info on using the DrawIcon procedure. However, >this only partially answers my question. What I also need is how I would >convert the hex representation of an icon (each pixel designated by a hex >digit 1-F, representing it's color) into an icon in the first place (not ^ 0-F! >from an icon editor but right in my program so I can then use DrawIcon). >As I said in my previous post, I am using TML Pascal so I'd appreciate >Pascal examples although I also know C. You need 2 things: some space in memory to construct the *real* image of the icon, and a way to convert the hex strings into real data. To get the space, just declare an array of char as big as you want. VAR MyIcon: array[0..200] of char; or whatever. Then use StuffHex to convert the data (look it up in your TML manual to get the parameters right--I may have them wrong here). Something like StuffHex(@MyIcon[0],'01fe02fd03fc'); StuffHex(@MyIcon[6],'04fb05fa06f9'), etc. >Another question someone may know the answer to is how I would write text >to the desktop screen using something other than Shaston 8 font. For example, >how would I write with New York, Bold, 24 point. I have tried various >combinations of the Font Manager commands to no avail, and using DrawString >(maybe I shouldn't use DrawString?). Again, thanks much for help. You *need* those toolbox reference manuals. Have you successfully loaded and started up the font manager? Once you've done that, use GetFamNum to help compute a FontID to feed to InstallFont. Make sure that you have SetPort to the right port (the one you want to set the font for) before calling InstallFont. SetTextFace will let you ask for Bold. Note that you should *not* use hard-coded family numbers--use family names instead. --Dave Lyons, Apple Computer, Inc. | DAL Systems AppleLink--Apple Edition: DAVE.LYONS | P.O. Box 875 AppleLink--Personal Edition: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.