snapshot and background problems

Michael D Mays michael at michaelsmanias.com
Tue Jun 29 10:35:24 EDT 2010


So when I do something like
	set the filename of image "Image" to filepath
that data is 'the text of the image or just 'the image' which backs the image in its original format. When I ask for 'the imagedata of the image' I get four bytes for each pixel in the image: one byte of zeroes, a byte representing red, blue and green. There is also an alphadata which has a byte of alphadata for each pixel in the image. This data is a serialized stream which  representing in sequence  the data : left top pixel ... right top pixel, left pixel of the second row ... right pixel of second, left pixel of third row ... right bottom pixel. In a sense the imagedata has alphadata information set to zero (no transparency). 

How do I put the image in an image into a variable or property?

Michael


On Jun 28, 2010, at 1:53 PM, J. Landman Gay wrote:

> Scott Rossi wrote:
> 
>> I have no data to suggest that setting the text of an image is any better or
>> worse than the method of putting image-related data into an image.  I've
>> only seen references by the programming dudes at RunRev to use the text
>> property, so I do.
> 
> They're different properties for different purposes. The imagedata is basically just a screen shot and if you set the imagedata of an image object, what you end up with is just a bitmap. All other binary info is lost, including channel data. If you set the imagedata of an image object that isn't exactly the same size as the original screen shot, the image will corrupt and become unrecognizable. The imagedata must match the size of the image object exactly to display properly. (Once it's set correctly, you can then scale it, but it will look terrible.)
> 
> Setting the text of an image (or just putting an image reference into an image object, it's the same thing) stores all the binary data, including the alpha channel, and the image is scalable and can be manipulated in lots of ways. The size of the image object does not need to match anything in particular, since the engine will scale the data as needed.
> 
> Imagedata is useful for creating thumbnails, for example, or for reducing the size footprint of an image in the stack when you know you'll never need to change the displayed bitmap. You can reduce the size of the image internally substantially by using imagedata. Setting the text of an image is more useful if you want to retain all the image properties and manipulate it (rotate, scale, etc.)
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list