[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #_DrawPicture and the mac heap

>Yes, I've noticed strange crashes when drawing very big pictures
>(say with 5000 lines in them).
>What precisely is the fix?  How exactly does one lock things
>down in mmemory?

I believe the following scheme may work (untested):

...[assume handle is, in fact, a handle to a PICT and you have set up
   (let* ((size (#_GetHandleSize handle))
          (workspace (#_NewHandle (* size 2)))) ;may need to add a little
      (if (handlep workspace)
          (#_DisposeHandle workspace)
          (#_DrawPicture handle rect))
        [suitable error message or action]
"TANSTAAFL" Rich lynch@ils.nwu.edu