[net.micro.mac] graphics query

henry@rochester.UUCP (09/20/85)

From: Henry.Kautz

I am starting to program my mac, and would like some advice about how
to generate and include graphic objects as resources.  Icons and fonts
are straightforward, but how do you create a PICT resource?  What about
a bitmap?  (Is there even a resource type for bitmap)?  MacDraw seems
to have a "pict" format option under the save-as command, but the
resulting file does not seem to have any resources.  Do you have to
convert the macdraw file in some way to get the resource?  If so, how
is the picture-frame for the original picture specified?  How can I
include graphics generated with MacPaint as resources?  It seems that
it should be straightforward to write a program that converts parts of
Macpaint files into bitmaps, and then saves them as resources, but
surely someone has done this before!  Any information appreciated.
---- Henry Kautz
	:uucp:	{seismo|allegra}!rochester!henry
	:arpa:	henry@rochester
	:mail:  Dept. of Comp. Sci., U. of Rochester, NY 14627
	:phone: (716) 275-5766

---- Henry Kautz
	:uucp:	{seismo|allegra}!rochester!henry
	:arpa:	henry@rochester
	:mail:  Dept. of Comp. Sci., U. of Rochester, NY 14627
	:phone: (716) 275-5766

stew@harvard.ARPA (Stew Rubenstein) (09/21/85)

In article <11747@rochester.UUCP> henry@rochester.UUCP writes:

>I am starting to program my mac, and would like some advice about how
>to generate and include graphic objects as resources.  Icons and fonts
>are straightforward, but how do you create a PICT resource?

The easiest way to do this is to create the picture in MacDraw or MacPaint
or whatever, Cut it, and Paste it into the ScrapBook.  The ScrapBook File
is nothing but a bunch of PICT or TEXT resources (and an SMAP used internally).
Then use the Resource Editor to move it into your resource file.

>What about a bitmap?  (Is there even a resource type for bitmap)?

No, not an Apple-defined one, anyway.  Pictures can be converted to
BitMaps by drawing them into an offscreen GrafPort.  BitMaps can be
converted to Pictures by an OpenPicture, CopyBits, ClosePicture
sequence.

Stew
{seismo, ut-sally} ! harvard ! stew

bhyde@inmet.UUCP (09/25/85)

I have found MacPascal an acceptable way to build PICT resources.
It is a little buggy around using user resource files, but once
you have a senerio that works then it works out fine.  This is
a good technique if your pictures are can benifit from a procedural
approach to defining them.
  Fonts are a great way to get a lot of little graphics into an 
application.  Particularly since they are fast, and well packed.  I usually
have a application specific font with most of the little icons and
trimmings in it.  I learned this trick from MacPaint where all the tools are
defined in a font.
  The scrapbook is a good tool for getting applications to  produce
a PICT resource for you.  That's good for getting graphs out of 
Microsoft-graph and into your application.   A good trick for applications
that need "graph paper."
  The source of the picture frame seems to be a mess.  Sometimes the
clipping region's bounds are the safest thing.  I am unaware of what the
"right" source for the frame is, anybody know?
   ben hyde, cambridge.

lsr@apple.UUCP (Larry Rosenstein) (09/26/85)

In article <369@harvard.ARPA> stew@harvard.UUCP (Stew Rubenstein) writes:
>In article <11747@rochester.UUCP> henry@rochester.UUCP writes:
>
>>What about a bitmap?  (Is there even a resource type for bitmap)?
>
>No, not an Apple-defined one, anyway.  Pictures can be converted to
>BitMaps by drawing them into an offscreen GrafPort.  BitMaps can be
>converted to Pictures by an OpenPicture, CopyBits, ClosePicture
>sequence.
>

You should store bitmaps as PICT resource, because then they will be
compressed and take up less space.  (Plus you don't need to handle 2
different resource types.)  Bill Atkinson's PaintMover should allow
you copy an arbitrary part of a MacPaint document and paste it into
the Scrapbook, from which you can get a PICT resource.

-- 
Larry Rosenstein
Apple Computer

UUCP:  {voder, idi, nsc, ios, mtxinu, dual}!apple!lsr
CSNET: lsr@Apple.CSNET