Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Feb 18, 2020 8:14 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: How to assign a server side image file to a WebImageView.
PostPosted: Wed Dec 22, 2010 11:45 am 
Offline

Joined: Mon Jul 02, 2007 11:25 pm
Posts: 56
Location: Liberty Lake, WA
I've been using REALBasic for a number of years and have been doing mostly database oriented programming. Occasionally, I've loaded FolderItems into a Canvas object. But, with this new Web Edition, I haven't a clue as to how to do this. How do I assign an image file located on the server to an object on a web page or a BLOB field in a database field to display on a web page. Can anyone help me with the concepts and a good example or two?

_________________
MacBook Pro Retina 16GB Ram
RB 2011 R1.1 Enterprise Edition on Mac OS X Snow Leopard 10.8.2 (for desktop)
RB 2012 R2 Enterprise Edition on Mac OS X Snow Leopard 10.8.2 (for web)


Top
 Profile  
Reply with quote  
 Post subject: Re: How to assign a server side image file to a WebImageView
PostPosted: Wed Dec 22, 2010 1:36 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
I made a request on feedback for having more options on the WebImage class. Like passing a folderitem for an existing jpeg/png image. Or maybe an URL could also be fine.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: How to assign a server side image file to a WebImageView
PostPosted: Wed Dec 22, 2010 1:51 pm 
Offline

Joined: Mon Jul 02, 2007 11:25 pm
Posts: 56
Location: Liberty Lake, WA
MonkeybreadSoftware wrote:
I made a request on feedback for having more options on the WebImage class. Like passing a folderitem for an existing jpeg/png image. Or maybe an URL could also be fine.

Greetings
Christian

So, are you saying there isn't a way of doing this currently?

_________________
MacBook Pro Retina 16GB Ram
RB 2011 R1.1 Enterprise Edition on Mac OS X Snow Leopard 10.8.2 (for desktop)
RB 2012 R2 Enterprise Edition on Mac OS X Snow Leopard 10.8.2 (for web)


Top
 Profile  
Reply with quote  
 Post subject: Re: How to assign a server side image file to a WebImageView
PostPosted: Wed Dec 22, 2010 2:14 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Sign on: feedback://showreport?report_id=14950

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: How to assign a server side image file to a WebImageView
PostPosted: Thu Dec 23, 2010 1:09 am 
Offline

Joined: Tue Oct 04, 2005 2:33 pm
Posts: 94
Location: Cambridge, UK
Doesn't the Slideshow example provided by RS do exactly this?

It loads images from a folder and presents them in an ImageView...or have I misunderstood your requirements?

Cheers

Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: How to assign a server side image file to a WebImageView
PostPosted: Tue May 03, 2011 10:47 pm 
Offline

Joined: Mon Jul 02, 2007 11:25 pm
Posts: 56
Location: Liberty Lake, WA
paulfiner wrote:
Doesn't the Slideshow example provided by RS do exactly this?

It loads images from a folder and presents them in an ImageView...or have I misunderstood your requirements?

Cheers

Paul

No, it loads images that have already been loaded directly into the project in the IDE. It only displays those images as far as I can tell.

I'm still looking for a way to load an image from the Server hard drive or from a BLOB field in a database into the WebImageView object. Any ideas?

_________________
MacBook Pro Retina 16GB Ram
RB 2011 R1.1 Enterprise Edition on Mac OS X Snow Leopard 10.8.2 (for desktop)
RB 2012 R2 Enterprise Edition on Mac OS X Snow Leopard 10.8.2 (for web)


Top
 Profile  
Reply with quote  
 Post subject: Re: How to assign a server side image file to a WebImageView
PostPosted: Wed May 04, 2011 4:15 am 
Offline
User avatar

Joined: Tue Jan 04, 2011 3:02 am
Posts: 1236
Location: Jönköping, Sweden
It's easy, I'll post an example in a minute or so :)

_________________
Image http://www.linkedin.com/in/albinkiland
Dev. iMac 27" + 2x22" LG (2.8GHz Intel Core i7, 12GB RAM, 120GB SSD) OS X 10.8
Xojo Pro 2013r1


Top
 Profile  
Reply with quote  
 Post subject: Re: How to assign a server side image file to a WebImageView
PostPosted: Wed May 04, 2011 4:51 am 
Offline
User avatar

Joined: Tue Jan 04, 2011 3:02 am
Posts: 1236
Location: Jönköping, Sweden
Okay, here's a "how-to" to load a server-side image into a WebImageView :)

Add a property to your WebPage called WF as WebFile first and then call this code.
It will open aan image called logo.jpg that resides in the same folder as the executable itself.
You might have to alter the GetFolderItem to work on the system your app runs on. The example works on Mac OS X as it is.
If you'll run the app on a Linux server, as I do, it would be: f = GetFolderItem(App.ExecutableFile.Parent.ShellPath + "/logo.picture", FolderItem.PathTypeShell)

Dim f as FolderItem

f = GetFolderItem(App.ExecutableFile.Parent.AbsolutePath + "logo.jpg")
if f<>nil and f.Exists then
WF = New WebFile
WF = WebFile.Open(f)
ImageView1.URL = WF.URL
else
//Could not load image...
end if


Hope it works for you :)

_________________
Image http://www.linkedin.com/in/albinkiland
Dev. iMac 27" + 2x22" LG (2.8GHz Intel Core i7, 12GB RAM, 120GB SSD) OS X 10.8
Xojo Pro 2013r1


Top
 Profile  
Reply with quote  
 Post subject: Re: How to assign a server side image file to a WebImageView
PostPosted: Thu May 05, 2011 11:16 am 
Offline
User avatar

Joined: Mon Apr 09, 2007 2:49 pm
Posts: 190
Akiland wrote:
Dim f as FolderItem
f = GetFolderItem(App.ExecutableFile.Parent.AbsolutePath + "logo.jpg")
[...]



Your post helped me in another matter, thanks!

However, do you have any reason not to use the FolderItem method child here?
f = App.ExecutableFile.Parent.Child("logo.jpg")


These methods were build specifically so we can forget about platform issues. If there are any issues, you should definitely report them.

Klaus


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group