[comp.sys.mac.programmer] PICT into resource

gb2a+@andrew.cmu.edu (George J. Baxter) (01/26/91)

Dear World,
    I'm trying to load a somewhat complicated (though I believe less
than 32K) PICT image into a PICT resource to use in a modeless dialog. 
How the begeebers to I pull it off?  I have managed to do the cut and
paste routine with PixelPaint Pro. and ResEdit 2.0d3, but it makes it a
bitmap, and is _VERY_ slow when I call 'DrawPicture'.  So I tried to do
a cut from MacDraw and paste into ResEdit, but it wouldn't go, same
result with SuperPaint.  Any suggestions?
                    
                            -george
-----------------------
gb2a@andrew.cmu.edu		    baxter@a.cfr.cmu.edu

baxter@imga.cfr.cmu.edu		    q100gb2a@vb.cc.cmu.edu

"Only a Hawaiian can say Humuhumunukunukuapuaa five times fast, correctly."

peirce@outpost.UUCP (Michael Peirce) (01/26/91)

In article <Ebc7OgK00WBMM2QUZJ@andrew.cmu.edu>, gb2a+@andrew.cmu.edu (George J. Baxter) writes:
> 
> Dear World,
>     I'm trying to load a somewhat complicated (though I believe less
> than 32K) PICT image into a PICT resource to use in a modeless dialog. 
> How the begeebers to I pull it off?  I have managed to do the cut and
> paste routine with PixelPaint Pro. and ResEdit 2.0d3, but it makes it a
> bitmap, and is _VERY_ slow when I call 'DrawPicture'.  So I tried to do
> a cut from MacDraw and paste into ResEdit, but it wouldn't go, same
> result with SuperPaint.  Any suggestions?

It sound like it's drawing the Picture, just slowly, right?

Make sure the bounding rectangle of the PICT matches the rectangle
that your drawing into.  If they're different, COPYBITS will scale
the thing and that can take a far amount of time.

Also, you mention calling DrawPicture.  Why not just use a Picture
item in the DITL.  Then use the ResEdit menu item called "Use Resource
Rectangle" to have it size the item rectangle to be the same as the
native PICT bounds rectangle.

Also, you might want to get RedEdit 2.1.  It's not a beta or development
version like you have and, although not bug free, is much better than
the version you are using.

-- michael


--  Michael Peirce         --   outpost!peirce@claris.com
--  Peirce Software        --   Suite 301, 719 Hibiscus Place
--  Macintosh Programming  --   San Jose, California 95117
--           & Consulting  --   (408) 244-6554, AppleLink: PEIRCE

delann@cs.umu.se (Anders Nyman) (01/26/91)

In article <Ebc7OgK00WBMM2QUZJ@andrew.cmu.edu> gb2a+@andrew.cmu.edu (George J. Baxter) writes:
>Dear World,
>    I'm trying to load a somewhat complicated (though I believe less
>than 32K) PICT image into a PICT resource to use in a modeless dialog. 
>How the begeebers to I pull it off?  I have managed to do the cut and
>paste routine with PixelPaint Pro. and ResEdit 2.0d3, but it makes it a
>bitmap, and is _VERY_ slow when I call 'DrawPicture'.  So I tried to do
>a cut from MacDraw and paste into ResEdit, but it wouldn't go, same
>result with SuperPaint.  Any suggestions?
>                    

Try to first paste the picture to the Scrapbook. After that you go to your
ResEditor and open the scrapbook file in the systemfolder. Look in the PICT
resource after your picture, cut it and paste into your own resourcefile.

Hope it works for you!
/Anders N.

dmac@athena.mit.edu (David S. McCormick) (02/01/91)

In article <Ebc7OgK00WBMM2QUZJ@andrew.cmu.edu> gb2a+@andrew.cmu.edu 
(George J. Baxter) writes:
>     I'm trying to load a somewhat complicated (though I believe less
> than 32K) PICT image into a PICT resource to use in a modeless dialog. 
> How the begeebers to I pull it off?  I have managed to do the cut and
> paste routine with PixelPaint Pro. and ResEdit 2.0d3, but it makes it a
> bitmap, and is _VERY_ slow when I call 'DrawPicture'.  So I tried to do
> a cut from MacDraw and paste into ResEdit, but it wouldn't go, same
> result with SuperPaint.  Any suggestions?

I created a PICT in Canvas, copied the pict to the scrap, then pasted it 
back in via Paste Pict or Paste Special, then used the Object... dialog to 
change the thing to a bitmap. This solved several problems: (1) the PICT 
was then very small in size, (2) there was no dependence of the image on 
the systems for fonts being present. The image was then pasted into a PICT 
resource via ResEdit, and the thing worked like a charm. You may be able 
to toggle PICT's from pure Pictures (i.e. sequence of drawing commands) 
into a PICT bitmap in other programs. Try it. I hope this is helpful.


David McCormick
MIT-EAPS Geology
dmac@athena.mit.edu

kpottie@icarus.cs.kuleuven.ac.be (Pottie Karl) (02/06/91)

TeachTextMaker (in the sumex archives) also has got an option to convert
pict drawings into pict bitmaps.
The version in the archives has got a little bug, so if you want to export
the converted picture back to another program, you'll have to be running
unifinder.
Picts converted this way will draw *much* faster on screen.

rad@genco.bungi.com (Bob Daniel) (02/06/91)

>In article <Ebc7OgK00WBMM2QUZJ@andrew.cmu.edu> gb2a+@andrew.cmu.edu (George J. Baxter) writes:
>>Dear World,
>>    I'm trying to load a somewhat complicated (though I believe less
>>than 32K) PICT image into a PICT resource to use in a modeless dialog. 
>>How the begeebers to I pull it off?  I have managed to do the cut and
>>paste routine with PixelPaint Pro. and ResEdit 2.0d3, but it makes it a
>>bitmap, and is _VERY_ slow when I call 'DrawPicture'.  So I tried to do
>>a cut from MacDraw and paste into ResEdit, but it wouldn't go, same
>>result with SuperPaint.  Any suggestions?

After you paste the picture into your DLOG, select the picture when a DITL 
item and select 'Use resource rectangle' in ResEdit.  This will use the
proper size rectangle for the PICT and draw quickly.  I dunno if this is
your problem but it sure sounds like this is it.

The World,
Moof Moof

roland@dna.lth.se (Roland Mansson) (02/13/91)

In article <1750@n-kulcs.cs.kuleuven.ac.be> kpottie@icarus.cs.kuleuven.ac.be (Pottie Karl) writes:
>TeachTextMaker (in the sumex archives) also has got an option to convert
>pict drawings into pict bitmaps.
>The version in the archives has got a little bug, so if you want to export
>the converted picture back to another program, you'll have to be running
>unifinder.
>Picts converted this way will draw *much* faster on screen.
...and they will look much worse when printed.

-- 
Roland Mansson, Lund University Computing Center, Box 783, S220 07 Lund, Sweden
Phone: +46-46107436   Fax: +46-46138225   Bitnet: roland_m@seldc52
Internet: roland.mansson@ldc.lu.se   or   roland.mansson%ldc.lu.se@uunet.uu.net
UUCP: {uunet,mcvax}!sunic!ldc.lu.se!roland.mansson    AppleLink: SW0022