How do I get the browser to open a jpeg
Posted: Tue Jul 24, 2012 6:49 am
According to the documentation I should be able to do the following
-- We use this variable to store the id of the UIWebView native
-- control.
local sBrowserId
on preOpenCard
if the environment is not "mobile" then
exit preOpenCard
end if
-- Create our browser control and store the id
iphoneControlCreate "browser"
put the result into sBrowserId
-- Native controls start off invisible
iphoneControlSet sBrowserId, "visible", "true"
local theFile
put specialFolderPath("Documents") & "/test.jpg" into theFile
-- Set up a suitable initial url
iphoneControlSet sBrowserId, "url", "binfile:"&theFile
-- Make sure everything is the right size
resizeStack
end preOpenCard
However, when the browser loads, its empty.
Despite that fact that I've just saved this image.
local theFile
put specialFolderPath("Documents") & "/test.jpg" into theFile
export image "Bigimage" to file theFile as JPEG
put URL ("binfile:" & theFile) into image "Bigimage"
Which works fine. i.e. it saves an image then puts the same image back to verify that the save worked.
So what am I missing? Why won't the browser display the file?
-B
-- We use this variable to store the id of the UIWebView native
-- control.
local sBrowserId
on preOpenCard
if the environment is not "mobile" then
exit preOpenCard
end if
-- Create our browser control and store the id
iphoneControlCreate "browser"
put the result into sBrowserId
-- Native controls start off invisible
iphoneControlSet sBrowserId, "visible", "true"
local theFile
put specialFolderPath("Documents") & "/test.jpg" into theFile
-- Set up a suitable initial url
iphoneControlSet sBrowserId, "url", "binfile:"&theFile
-- Make sure everything is the right size
resizeStack
end preOpenCard
However, when the browser loads, its empty.
Despite that fact that I've just saved this image.
local theFile
put specialFolderPath("Documents") & "/test.jpg" into theFile
export image "Bigimage" to file theFile as JPEG
put URL ("binfile:" & theFile) into image "Bigimage"
Which works fine. i.e. it saves an image then puts the same image back to verify that the save worked.
So what am I missing? Why won't the browser display the file?
-B