Hey All,
I seem to be having an issue with loading external image data and then setting that data to an image object. Here is what I am trying to do,
// Load Image Data Script (this seems to work fine and has the image data stored in the variable)
put URL("binfile:"&tAppPath & "ImageFile.png" ) into tImgData
// Code to display the image data (This creates an image but image does not show)
create invisible image
put the long id of the last image into tID
set the imageData of tID to tImgData
set the width of tID to the cScaledWidth of tID
set the height of tID to the cScaledHeight of tID
set the loc of tID to the cScaledLoc of tID
set the visible of tID to true
It may seem that I am doing something incorrect here and was hoping someone can point me into the right direction.
Load External Image Data Not Working
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Load External Image Data Not Working
Hi CenturyMan1979,
you can only set "the imagedata" if the image where you put this into has the exact dimensions!
as the original image where the image data comes from! Know what I mean?
...
put URL("binfile:"&tAppPath & "ImageFile.png" ) into tImgData
## This will have the DEFAULT size (width/height) for newly created images and obvioulsy NOT the size of the "ImageFile.png"
create invisible image
put the long id of last image into tID
## This also does not work, no idea why...
## put tImgData into tID
## This does work:
put tImgData into last img
...
Best
Klaus
you can only set "the imagedata" if the image where you put this into has the exact dimensions!
as the original image where the image data comes from! Know what I mean?
...
put URL("binfile:"&tAppPath & "ImageFile.png" ) into tImgData
## This will have the DEFAULT size (width/height) for newly created images and obvioulsy NOT the size of the "ImageFile.png"
create invisible image
put the long id of last image into tID
## This also does not work, no idea why...
## put tImgData into tID
## This does work:
put tImgData into last img
...
Best
Klaus
-
- Posts: 86
- Joined: Tue May 15, 2012 5:56 pm
Re: Load External Image Data Not Working
Thanks Klaus that worked a charm. Also found this to work also,
// Code to display the image data (This creates an image but image does not show)
create invisible image
put the long id of the last image into tID
put the short id of tID into tShortID
put tImgData into image id tShortID
set the width of tID to the cScaledWidth of tID
set the height of tID to the cScaledHeight of tID
set the loc of tID to the cScaledLoc of tID
set the visible of tID to true
I am creating a slide show application and I am locking the screen with a dissolve visual effect. When I would get to a slide that had a really large dimension image there was a noticeable delay in displaying the slide. I thought loading the image data before going into the slideshow would fix this but the issue remains the same. Next I am going to try loading these images into a seperate card and copy them over to the current card when running the slide show to see if that will work.
// Code to display the image data (This creates an image but image does not show)
create invisible image
put the long id of the last image into tID
put the short id of tID into tShortID
put tImgData into image id tShortID
set the width of tID to the cScaledWidth of tID
set the height of tID to the cScaledHeight of tID
set the loc of tID to the cScaledLoc of tID
set the visible of tID to true
I am creating a slide show application and I am locking the screen with a dissolve visual effect. When I would get to a slide that had a really large dimension image there was a noticeable delay in displaying the slide. I thought loading the image data before going into the slideshow would fix this but the issue remains the same. Next I am going to try loading these images into a seperate card and copy them over to the current card when running the slide show to see if that will work.
Re: Load External Image Data Not Working
Not that it matters since you have things working, but you can "set the text of image "myimage" to tImgData
Much more forgiving than setting the imagedata.
Much more forgiving than setting the imagedata.
Re: Load External Image Data Not Working
Even shorter, you can just put the url content into an image:
put url ("binfile:" & tImgPathOnDisk) into image 1
Unless I'm dealing with pixels on screen, I avoid the term "imageData". It doesn't mean what you think.
put url ("binfile:" & tImgPathOnDisk) into image 1
Unless I'm dealing with pixels on screen, I avoid the term "imageData". It doesn't mean what you think.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com