Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site ur-tut.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!qantel!dual!lll-crg!gymble!umcp-cs!seismo!rochester!ur-tut!llad
From: llad@ur-tut.UUCP (Dennis Venable)
Newsgroups: net.micro.mac
Subject: Problem with DA's, PICT, and Scrap
Message-ID: <144@ur-tut.UUCP>
Date: Wed, 2-Oct-85 17:31:49 EDT
Article-I.D.: ur-tut.144
Posted: Wed Oct  2 17:31:49 1985
Date-Received: Sun, 6-Oct-85 05:15:43 EDT
Reply-To: llad@ur-tut.UUCP (Dennis Venable)
Organization: Univ. of Rochester Computing Center
Lines: 43

I need help!  I am trying to write a nifty desk accessory that creates a
Quickdraw picture then copies it to the Desk Scrap for pasting into 
Scrapbook, MW, or whatever.  The problem is I can't get anything to show
up when I do the paste except a blank rectangle corresponding to the
picture frame I used in the OpenPicture call.  Here is the set of code
(Aztec C) I use to copy to the desk scrap:

toDeskScrap()
	{
	Picture **h;
	long len,io,offset;

	h = OpenPicture(&picF);
	Replay();
	ClosePicture();
	len = (long)((**h).picSize);
	io = ZeroScrap();
	HLock(h);
	io = PutScrap(len,'PICT',(char *)(*h));
	HUnlock(h);
	KillPicture(h);
	h = (Picture **)NewHandle(0L);
	EraseRect(&picF);
	len = GetScrap(h,'PICT',offset);
	DrawPicture(h,&picF);
	}

picF is a Rect defining the rectangle I have been drawing into, Replay() is a
function that redraws the rectangle (simple Qdraw calls).  The scrap routines
return zero's for io indicating their are happy with the call.  The GetScrap() 
successfully gets the picture just PutScrapped and DrawPicture() draws it just
fine.  If, however, I bring up Scrapbook (or anything else) and try to paste
the picture I get a blank rectangle!

WHAT AM I DOING WRONG???????????

Any aid here will be greatly appreciated!! Either personal or net responses are
fine with me, just please respond!

Thanks a lot!!

/Dennis L. Venable
{decvax,allegro,seismo}!rochester!ur-tut!llad