Imagedata row order

Jeanne A. E. DeVoto revolution at jaedworks.com
Tue Jul 25 20:52:30 EDT 2006


At 11:35 AM -0700 7/25/2006, Rob Cozens wrote:
>The text property is stored on disk?  Isn't that only if the image 
>is referenced instead of imported?

Right. (But if it's referenced, the text property is always empty anyway.)

>1.  I create a string of characters, 4 bytes per pixel  in imageData format .
>2.  I set the imageData of an image to my string
>3.  In what format is the image's text, if not rle?  GIF, JPEG, PNG, 
>PICT, BMP, PBM/PGM/PPM, or XBM/XPM/XWD?  Perhaps rle compresses the 
>data to 3 bytes per pixel by stripping the nulls?

It will be in RLE, unless you've set the format to something else - 
but RLE format isn't the same as the imageData. (It looks like the 
IDE sets the default paintCompression to PNG instead of RLE, so I 
suspect it will actually be PNG unless you're using a standalone.)

>4.  What happens if I "put" my imageData-formatted string into an 
>image?  Will the image not display correctly?  Does it throw an 
>error?  Is the string reformatted before being placed in the text 
>property?

You might get a crash, and you definitely won't get anything 
resembling the original image. Only by the rarest random chance would 
the imageData also be equivalent to valid RLE data - it's a 
structured format, and its structure isn't anything like the 
imageData pixmap structure.

>Perhaps we are approaching "use" from different viewpoints; but then 
>again it may all boil down to my misconception of what happens if I 
>set the text of an image to an imageData-formatted string.  If you 
>use "use" in the sense of "take the imageData as a starting point 
>for your modifications", you'll get no argument from me.  And if 
>setting the text of an image to an imageData-formatted string throws 
>an error, I'm flat out wrong.  But if it doesn't throw an error, 
>what does happen?

Well, as I say they're completely different formats. So setting the 
text of an image to an imageData-format set of data doesn't do 
anything sensible. It's just like setting the text of an image to the 
text of a field, or the contents of a random variable - it probably 
won't give a sensible result.
-- 
jeanne a. e. devoto ~ revolution at jaedworks.com
http://www.jaedworks.com



More information about the use-livecode mailing list