Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Resource PICTs are unreliable? (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: matt book 2.0 URL
Next thread: Re: Saving a 32 bit PICT to a file?


Re: Saving a 32 bit PICT to a file?   -   Matthias Buercher
  Resource PICTs are unreliable?   -   Noah Desch
   Re: Resource PICTs are unreliable?   -   Noah Desch

Resource PICTs are unreliable?
Date: 13.08.01 04:47 (Sun, 12 Aug 2001 23:47:36 -0400)
From: Noah Desch
I've been trying to track down a very strange bug in my undo code and I
found something really strange. I have this code:

// R is a resourceFork
// EditArea is a canvas subclass
// PasteBuffer is a picture of the currently selected area

If EditArea.PasteBuffer<>Nil then
R.AddPicture( EditArea.PasteBuffer, 129, "" )
canvas1.Graphics.Drawpicture EditArea.PasteBuffer,0,0
canvas2.Graphics.Drawpicture R.getpicture(129),0,0
end if

canvas1 shows the correct image
canvas2 _always_ shows a white picture of the correct dimensions (but it's
always white).

Opening the file with ResEdit confirms that PICT 129 is only white.

All the other pictures I write to this resource fork can be read back
correctly. PasteBuffer was created with NewPicture but so were all the
others. PasteBuffer has a mask but so does one of the others which saves
correctly. Doing AddPicture with PastBuffer.Mask works correctly.

This is under OSX so memory should not be an issue
More testing will follow...

-Noah Desch
Wireframe Software
http://wireframe.virtualave.net

"This could take thousands and thousands of nanoseconds... this might even
take a whole SECOND!"
-ReBoot, the best cartoon ever.

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Resource PICTs are unreliable?
Date: 14.08.01 01:20 (Mon, 13 Aug 2001 20:20:59 -0400)
From: Noah Desch

On Sunday, August 12, 2001, at 11:47 PM, Noah Desch wrote:

> All the other pictures I write to this resource fork can be read back
> correctly. PasteBuffer was created with NewPicture but so were all the
> others. PasteBuffer has a mask but so does one of the others which saves
> correctly. Doing AddPicture with PastBuffer.Mask works correctly.
>
> This is under OSX so memory should not be an issue
> More testing will follow...

Drawing the picture to a new picture and then saving the new picture
instead of the old one solved the problem, but I still can't figure out
what was different about this picture that made it not save to a resource
fork correctly...

-Noah Desch
Wireframe Software
http://wireframe.virtualave.net

Pentium 4 - doubles as a space heater in cold weather

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>