Page 1 of 1

HTMLText image (<img>) coloroverlay or background color

Posted: Sun Mar 07, 2010 2:17 am
by heyvern
I am using a project I found called "XML Tree". Working great for my project.

My question pertains to the <img> tag for inserting icons. I understand that RR has a "rudimentary" version of html built in for styling text and inserting graphics with text in a field. What I would like to do is to change the overlay color of an image inserted into the field. Can a single image referenced multiple times in a field have it's background color or overlay color changed? If so how do I know which one is which?

Basically what I'm doing is loading this icon for attributes in an xml file. Each of these attributes has an rgb color value I can extract. I would like to apply that rgb color to the image used as an icon for that line of the xml tree in the field. The code used to apply the icon is very simple:

Code: Select all

"<img src=" & quote & imageVariable & quote & ">"
Is there a way in that spot to apply the foreground or color overlay value? At this point in the processing I would have access to the color value in an array and can easily pull it out and "stick it in there"... uh... if I knew how. ;) IT seems that the HTMLText doesn't have that kind of styling? Is there a way to access an "ID" of that image? The tricky part for me is that it's just one image I want to change for each tag in a specific section of the xml or html text in a field.

Re: HTMLText image (<img>) coloroverlay or background color

Posted: Sun Mar 07, 2010 10:18 am
by Mark
heyvern,

Indeed, it seems that RunRev doesn't have that kind of styling, but you might try to set the backColor of the character that your image is attached to.

set the backColor of char 345 of fld "Your XML Display" to red

I don't know whether this works for images.

Best regards,

Mark

Re: HTMLText image (<img>) coloroverlay or background color

Posted: Sun Mar 07, 2010 11:05 pm
by heyvern
Thanks, yes, that was my next option.

Another option which I have to "learn" first would be to create the image reference "on the fly". Create a new graphic (very very very tiny. A few pixels of flat color) and then insert that into the HTMLText. This would work well because the text is processed before the icons are needed so I could loop through all the elements, create a whole pile of tiny icon images and then assign them to the HTML when the item is displayed. This wouldn't be too much overhead since the image files could even be 1 and scaled up. Or maybe I could use 1 original image and "copy/paste" it and fill it with a different color using the paint tools.

My concern would be the overhead on the application with all of those little images. However the total amount would barely be larger than 1 really big image in an application.