Re: HTML Text and Images

2010-10-06 Thread Ken Ray
 On Tue, Oct 5, 2010 at 7:32 PM, Ray Horsley r...@linkit.com wrote:
 
  If
 worse comes to worse I can always just keep the image I create to get the
 dimensions, resize it and use it instead.
 
 
 I think this is the only way.
 
 If you'd go with RevBrowser you could set image attribute such as height and
 width in the img tag but HTMLText does not work like that. Heck, I wish it
 was not called HTMLText but SGMLText or something like FancyTaggedText

Actually you can do it this way:

1) Retrieve the image from the web into an image object.
2) Change the size of the image object itself, making sure to keep the
dimensions consistent so you don't get stretching/skewing.
3) Lock the image object (set the lockLoc of image to true)
4) In your field, instead of setting the htmlText to the image with the ID
of the image object in img src.

Here's a simple example (I had to add a couple of returns before the text so
you could see the bird - watch linewraps):

on mouseUp
  set the lockLoc of img testImage to false
  set the filename of img testImage to 
  set the filename of image testImage to
http://linkit.com/Schools/ETS%20Items/ETS%20Item%20Bank/ETS10Q1/01%20Full%2
0Bank/04%20ELA%20QTI%20with%20GUIDs/Grade%20KLanguage%20Arts-95/images/38228
.jpg
  set the width of img testimage to (the width of img testimage/4)
  set the height of img testimage to (the height of img testimage/4)
  set the lockLoc of img testImage to true
  set the htmlText of fld 1 to (PPPHere's the bird img src=  quote
 (the id of img testImage)  quote  )
end mouseUp

Ken Ray
Sons of Thunder Software, Inc.
Email: k...@sonsothunder.com
Web Site: http://www.sonsothunder.com/


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: HTML Text and Images

2010-10-05 Thread BNig

Ray,

create an image object, call it testimage (could be hidden)
on mouseUp
   set the filename of image testImage to
http://linkit.com/Schools/ETS%20Items/ETS%20Item%20Bank/ETS10Q1/01%20Full%20Bank/04%20ELA%20QTI%20with%20GUIDs/Grade%20KLanguage%20Arts-95/images/38228.jpg;
   put the width of image testImage  the height of image testImage
end mouseUp
regards
Bernd
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/HTML-Text-and-Images-tp2956597p295.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: HTML Text and Images

2010-10-05 Thread Ray Horsley
Now honestly, why didn't I think of that?  I'll give it a try.

Thanks,

Ray

-Original Message-
From: use-revolution-boun...@lists.runrev.com
[mailto:use-revolution-boun...@lists.runrev.com] On Behalf Of BNig
Sent: Tuesday, October 05, 2010 2:50 PM
To: use-revolution@lists.runrev.com
Subject: Re: HTML Text and Images


Ray,

create an image object, call it testimage (could be hidden) on mouseUp
   set the filename of image testImage to
http://linkit.com/Schools/ETS%20Items/ETS%20Item%20Bank/ETS10Q1/01%20Full%2
0Bank/04%20ELA%20QTI%20with%20GUIDs/Grade%20KLanguage%20Arts-95/images/38228
.jpg
   put the width of image testImage  the height of image testImage
end mouseUp
regards
Bernd
--
View this message in context:
http://runtime-revolution.278305.n4.nabble.com/HTML-Text-and-Images-tp295659
7p295.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: HTML Text and Images

2010-10-05 Thread Ray Horsley
Bernd,

Works like a charm!  Now, any suggestions on how to resize the image which
is showing up when setting the htmlText of a field?  This is a tough one, I
know, and I don't think there is a way to do this.  I just thought I'd throw
it out there to see if anybody has any suggestions.

Thanks,

Ray

-Original Message-
From: use-revolution-boun...@lists.runrev.com
[mailto:use-revolution-boun...@lists.runrev.com] On Behalf Of BNig
Sent: Tuesday, October 05, 2010 2:50 PM
To: use-revolution@lists.runrev.com
Subject: Re: HTML Text and Images


Ray,

create an image object, call it testimage (could be hidden) on mouseUp
   set the filename of image testImage to
http://linkit.com/Schools/ETS%20Items/ETS%20Item%20Bank/ETS10Q1/01%20Full%2
0Bank/04%20ELA%20QTI%20with%20GUIDs/Grade%20KLanguage%20Arts-95/images/38228
.jpg
   put the width of image testImage  the height of image testImage
end mouseUp
regards
Bernd
--
View this message in context:
http://runtime-revolution.278305.n4.nabble.com/HTML-Text-and-Images-tp295659
7p295.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: HTML Text and Images

2010-10-05 Thread Andre Garzia
On Tue, Oct 5, 2010 at 3:15 PM, Ray Horsley r...@linkit.com wrote:

 Many thanks to Andre Garzia for help on this.  I'm still faced with some
 [possibly new] issues regarding setting the htmlText of a fld.  What I need
 is the height and width of images inside the htmlText.  Ideally I'd like to
 manipulate height and width.  I'm not downloading any images as files and
 I'm not using the binFile format so I don't believe they're residing
 anywhere on my local disk.

 Here's a typical span tag as an example:

 spanimg
 src=
 http://linkit.com/Schools/ETS%20Items/ETS%20Item%20Bank/ETS10Q1/01%20Fu

 ll%20Bank/04%20ELA%20QTI%20with%20GUIDs/Grade%20KLanguage%20Arts-95/images/3
 8228.jpg/span

 Set the htmlText of any field to this string and you get a pretty little
 bird, but how tall and how wide is that bird?


Ray,

I think you're on the verge of using the wrong tool for the job. I think
your needs might be better served by RevBrowser than the HTMLText property
of the fields.

First of all, that span tag will be worthless in the htmltext, it will just
be ignored. Other thing is that HTMLText is not HTML and thus does not
possess the necessary stuff under the hood to make things like image
manipulation or introspection possible. I don't think you can check how wide
or how tall an image is inside a field if the imagesource is set to a remote
location.

If you'd use a revBrowser window, it might be possible to check that data
with javascript.

If you just use the HTMLText thing, I don't think it is possible but I am
not an expert, someone here might know better. I think you might need to:

  *  Rethink if HTMLText is what you should be using and maybe consider
moving to a better hypertext container such as revbrowser (which is not a
field and thus not really editable)
  *  If you stay with HTMLText, then, you might need an auxiliary routine to
parse the HTMLText property to pick all the images from the remote location,
download them, manipulate them as needed and then use them in the HTMLText
thing.

Andre





 Thanks,

 Ray Horsley
 LinkIt! Software




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: HTML Text and Images

2010-10-05 Thread Ray Horsley
Andre,

Thanks again for your input here.  Jim Ault's suggestion is working well;
that I create an image, set its filename to the image's URL to get the
image's height and width and then delete the image.  The only thing I'm
really unable to do now is resize images.  I'm not sure how I would do that
going the browser route so I might just stick with the htmlText route.  If
worse comes to worse I can always just keep the image I create to get the
dimensions, resize it and use it instead.

Thanks,

Ray

-Original Message-
From: use-revolution-boun...@lists.runrev.com
[mailto:use-revolution-boun...@lists.runrev.com] On Behalf Of Andre Garzia
Sent: Tuesday, October 05, 2010 3:23 PM
To: How to use Revolution
Subject: Re: HTML Text and Images

On Tue, Oct 5, 2010 at 3:15 PM, Ray Horsley r...@linkit.com wrote:

 Many thanks to Andre Garzia for help on this.  I'm still faced with 
 some [possibly new] issues regarding setting the htmlText of a fld.  
 What I need is the height and width of images inside the htmlText.  
 Ideally I'd like to manipulate height and width.  I'm not downloading 
 any images as files and I'm not using the binFile format so I don't 
 believe they're residing anywhere on my local disk.

 Here's a typical span tag as an example:

 spanimg
 src=
 http://linkit.com/Schools/ETS%20Items/ETS%20Item%20Bank/ETS10Q1/01%20F
 u

 ll%20Bank/04%20ELA%20QTI%20with%20GUIDs/Grade%20KLanguage%20Arts-95/im
 ages/3
 8228.jpg/span

 Set the htmlText of any field to this string and you get a pretty 
 little bird, but how tall and how wide is that bird?


Ray,

I think you're on the verge of using the wrong tool for the job. I think
your needs might be better served by RevBrowser than the HTMLText property
of the fields.

First of all, that span tag will be worthless in the htmltext, it will just
be ignored. Other thing is that HTMLText is not HTML and thus does not
possess the necessary stuff under the hood to make things like image
manipulation or introspection possible. I don't think you can check how wide
or how tall an image is inside a field if the imagesource is set to a remote
location.

If you'd use a revBrowser window, it might be possible to check that data
with javascript.

If you just use the HTMLText thing, I don't think it is possible but I am
not an expert, someone here might know better. I think you might need to:

  *  Rethink if HTMLText is what you should be using and maybe consider
moving to a better hypertext container such as revbrowser (which is not a
field and thus not really editable)
  *  If you stay with HTMLText, then, you might need an auxiliary routine to
parse the HTMLText property to pick all the images from the remote location,
download them, manipulate them as needed and then use them in the HTMLText
thing.

Andre





 Thanks,

 Ray Horsley
 LinkIt! Software




--
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: HTML Text and Images

2010-10-05 Thread Andre Garzia
On Tue, Oct 5, 2010 at 7:32 PM, Ray Horsley r...@linkit.com wrote:

  If
 worse comes to worse I can always just keep the image I create to get the
 dimensions, resize it and use it instead.


I think this is the only way.

If you'd go with RevBrowser you could set image attribute such as height and
width in the img tag but HTMLText does not work like that. Heck, I wish it
was not called HTMLText but SGMLText or something like FancyTaggedText



-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution