Re: New to Get a Copy of Scaled Down Version of an Image
Try changing this line: put tImageData["image"] into image "currentpuzzle" to this: set the imageData of image "currentpuzzle" to tImageData["image"] -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On October 28, 2020 6:06:39 AM Sannyasin Brahmanathaswami via use-livecode wrote: Take for example [command] resizeToWidth tImage, 400 on resizeToWidth pImage,pSize local tOrigImgWidth, tOrigImgHeight, tRatio, tNewWidth, tNewHeight set the itemdel to "x" put item 1 of sCurrentGraphicRect into tOrigImgWidth put item 2 of sCurrentGraphicRect into tOrigImgHeight if tOrigImgWidth is 0 then exit resizeToWidth put pSize/tOrigImgWidth into tRatio put (tOrigImgHeight * tRatio) into tNewHeight put (tOrigImgWidth * tRatio) into tNewWidth set the rect of pImage to 0,0,tNewWidth,tNewHeight end resizeToWidth How do I get a copy, with the image scaled down, which is visible on screen? [coded] if (the width of tImage > the heigth of tImage ) then # portrait resizeToWidth tImage, 400 else # landscape resizeToHeigth tImage, 400 end if # now we set the img to the img "currentpuzzle" set the name of the last image to "currentpuzzle" # and copy the data, at 400px wide put the rect of the last image into tImageData["rect"] put the imageData of the last image into tImageData["image"] put tImageData["image"] into image "currentpuzzle" BUT the full scaled copy of the image "currentpuzzle" comes into view. I wanted to get a scaled down version? How do we implement this, from the dictionary The imageData, unlike the contents of the image container, is based on the picture as it's presented on the screen, not stored in the image object. This means that if you resize an image, the content of the image does not change, but its imageData does. If you create an image and then reduce its size, its imageData reflects the scaled-down, displayed image, not the original full-scale image. If you create a second image and set its imageData property to the imageData of the original image, resizing the first image back to the original dimensions displays the original image at full resolution, but resizing the second image does not, because setting its imageData transferred only the scaled-down version of the original. BR ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: New to Get a Copy of Scaled Down Version of an Image
https://www.dropbox.com/s/gdrsa4git7l6war/imager.livecode.zip?dl=0 Richmond On 28.10.20 13:34, Richmond wrote: Remember that you have to lock an image to stop it popping back to its original size. Or, alternatively, you could change the order of your code. Also, you have misspelt 'height' in "resizeToHeigth". Also, while you have defined "resizeToWidth", you don't appear to have defined "resizeToHeight" in the code you have posted. The whole procedure looks a bit wonky: so I shall "go away" and try my own version. Best, Richmond. On 28.10.20 12:28, Sannyasin Brahmanathaswami via use-livecode wrote: Take for example [command] resizeToWidth tImage, 400 on resizeToWidth pImage,pSize local tOrigImgWidth, tOrigImgHeight, tRatio, tNewWidth, tNewHeight set the itemdel to "x" put item 1 of sCurrentGraphicRect into tOrigImgWidth put item 2 of sCurrentGraphicRect into tOrigImgHeight if tOrigImgWidth is 0 then exit resizeToWidth put pSize/tOrigImgWidth into tRatio put (tOrigImgHeight * tRatio) into tNewHeight put (tOrigImgWidth * tRatio) into tNewWidth set the rect of pImage to 0,0,tNewWidth,tNewHeight end resizeToWidth How do I get a copy, with the image scaled down, which is visible on screen? [coded] if (the width of tImage > the heigth of tImage ) then # portrait resizeToWidth tImage, 400 else # landscape resizeToHeigth tImage, 400 end if # now we set the img to the img "currentpuzzle" set the name of the last image to "currentpuzzle" # and copy the data, at 400px wide put the rect of the last image into tImageData["rect"] put the imageData of the last image into tImageData["image"] put tImageData["image"] into image "currentpuzzle" BUT the full scaled copy of the image "currentpuzzle" comes into view. I wanted to get a scaled down version? Svasti Astu – Be Well Brahmanathaswami Get SivaSiva.app – It free! https://www.himalayanacademy.com/view/sivasiva ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: New to Get a Copy of Scaled Down Version of an Image
Remember that you have to lock an image to stop it popping back to its original size. Or, alternatively, you could change the order of your code. Also, you have misspelt 'height' in "resizeToHeigth". Also, while you have defined "resizeToWidth", you don't appear to have defined "resizeToHeight" in the code you have posted. The whole procedure looks a bit wonky: so I shall "go away" and try my own version. Best, Richmond. On 28.10.20 12:28, Sannyasin Brahmanathaswami via use-livecode wrote: Take for example [command] resizeToWidth tImage, 400 on resizeToWidth pImage,pSize local tOrigImgWidth, tOrigImgHeight, tRatio, tNewWidth, tNewHeight set the itemdel to "x" put item 1 of sCurrentGraphicRect into tOrigImgWidth put item 2 of sCurrentGraphicRect into tOrigImgHeight if tOrigImgWidth is 0 then exit resizeToWidth put pSize/tOrigImgWidth into tRatio put (tOrigImgHeight * tRatio) into tNewHeight put (tOrigImgWidth * tRatio) into tNewWidth set the rect of pImage to 0,0,tNewWidth,tNewHeight end resizeToWidth How do I get a copy, with the image scaled down, which is visible on screen? [coded] if (the width of tImage > the heigth of tImage ) then # portrait resizeToWidth tImage, 400 else # landscape resizeToHeigth tImage, 400 end if # now we set the img to the img "currentpuzzle" set the name of the last image to "currentpuzzle" # and copy the data, at 400px wide put the rect of the last image into tImageData["rect"] put the imageData of the last image into tImageData["image"] put tImageData["image"] into image "currentpuzzle" BUT the full scaled copy of the image "currentpuzzle" comes into view. I wanted to get a scaled down version? Svasti Astu – Be Well Brahmanathaswami Get SivaSiva.app – It free! https://www.himalayanacademy.com/view/sivasiva ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
New to Get a Copy of Scaled Down Version of an Image
Take for example [command] resizeToWidth tImage, 400 on resizeToWidth pImage,pSize local tOrigImgWidth, tOrigImgHeight, tRatio, tNewWidth, tNewHeight set the itemdel to "x" put item 1 of sCurrentGraphicRect into tOrigImgWidth put item 2 of sCurrentGraphicRect into tOrigImgHeight if tOrigImgWidth is 0 then exit resizeToWidth put pSize/tOrigImgWidth into tRatio put (tOrigImgHeight * tRatio) into tNewHeight put (tOrigImgWidth * tRatio) into tNewWidth set the rect of pImage to 0,0,tNewWidth,tNewHeight end resizeToWidth How do I get a copy, with the image scaled down, which is visible on screen? [coded] if (the width of tImage > the heigth of tImage ) then # portrait resizeToWidth tImage, 400 else # landscape resizeToHeigth tImage, 400 end if # now we set the img to the img "currentpuzzle" set the name of the last image to "currentpuzzle" # and copy the data, at 400px wide put the rect of the last image into tImageData["rect"] put the imageData of the last image into tImageData["image"] put tImageData["image"] into image "currentpuzzle" BUT the full scaled copy of the image "currentpuzzle" comes into view. I wanted to get a scaled down version? How do we implement this, from the dictionary The imageData, unlike the contents of the image container, is based on the picture as it's presented on the screen, not stored in the image object. This means that if you resize an image, the content of the image does not change, but its imageData does. If you create an image and then reduce its size, its imageData reflects the scaled-down, displayed image, not the original full-scale image. If you create a second image and set its imageData property to the imageData of the original image, resizing the first image back to the original dimensions displays the original image at full resolution, but resizing the second image does not, because setting its imageData transferred only the scaled-down version of the original. BR ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
New to Get a Copy of Scaled Down Version of an Image
Take for example [command] resizeToWidth tImage, 400 on resizeToWidth pImage,pSize local tOrigImgWidth, tOrigImgHeight, tRatio, tNewWidth, tNewHeight set the itemdel to "x" put item 1 of sCurrentGraphicRect into tOrigImgWidth put item 2 of sCurrentGraphicRect into tOrigImgHeight if tOrigImgWidth is 0 then exit resizeToWidth put pSize/tOrigImgWidth into tRatio put (tOrigImgHeight * tRatio) into tNewHeight put (tOrigImgWidth * tRatio) into tNewWidth set the rect of pImage to 0,0,tNewWidth,tNewHeight end resizeToWidth How do I get a copy, with the image scaled down, which is visible on screen? [coded] if (the width of tImage > the heigth of tImage ) then # portrait resizeToWidth tImage, 400 else # landscape resizeToHeigth tImage, 400 end if # now we set the img to the img "currentpuzzle" set the name of the last image to "currentpuzzle" # and copy the data, at 400px wide put the rect of the last image into tImageData["rect"] put the imageData of the last image into tImageData["image"] put tImageData["image"] into image "currentpuzzle" BUT the full scaled copy of the image "currentpuzzle" comes into view. I wanted to get a scaled down version? Svasti Astu – Be Well Brahmanathaswami Get SivaSiva.app – It free! https://www.himalayanacademy.com/view/sivasiva ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode