0

Colorizing an image after server roundtrip

Hi,

I have a situation where I need to colorize an image using image.colorize = "#RRGGBB", but only after a call has been made to the server to find out what color the image needs to go. When I use the same piece of code in _createView or _updateView works perfectly, but when I place it in the callback from loading data, the image disappears. Is this a known bug?

by
5 Replies
  • Nope, definitely not a known bug. I'd need to see a code snippet at minimum to be able to help further. Please either email tvwidgets@yahoo-inc.com or post here in the forums.

    Thanks!

    -Jeremy
    0
  • QUOTE (Jeremy Johnstone @ Jul 6 2009, 09:02 AM) <{POST_SNAPBACK}>
    Nope, definitely not a known bug. I'd need to see a code snippet at minimum to be able to help further. Please either email tvwidgets@yahoo-inc.com or post here in the forums.

    Thanks!

    -Jeremy

    I've seen this "colorize bug" myself whenever I dynamically change the colorize value of an image. The 1st time I set the colorize value of an image the colorizing works properly, but the next time I change the colorize value the image appears all black. I have had to resort to removing the image, and re-appending each time before I apply a colorize value. While this gets around the issue, it is not ideal.
    0
  • We have seen the same thing. The re-append was the solution we documented a the only work around.

    We came up with this function to do it quickly. Hope this helps everyone.
    CODE
    function swap_colorize(obj,properties)
    {
    var tthis = obj.parentNode;
    obj = {};
    obj = new KONtx.element.Image(properties).appendTo(tthis);
    }

    //Usage
    swap_colorize( this.controls.myimage, { src:'http.//...image.png', styles: {colorize:'#FF0000'....} } );
    0
  • QUOTE (WidgetRealm @ Dec 28 2009, 01:35 PM) <{POST_SNAPBACK}>
    We have seen the same thing. The re-append was the solution we documented a the only work around.

    We came up with this function to do it quickly. Hope this helps everyone.
    CODE
    function swap_colorize(obj,properties)
    {
    var tthis = obj.parentNode;
    obj = {};
    obj = new KONtx.element.Image(properties).appendTo(tthis);
    }

    //Usage
    swap_colorize( this.controls.myimage, { src:'http.//...image.png', styles: {colorize:'#FF0000'....} } );

    Thanks for sharing this. Do you ever actually remove the previous image before re-appending?
    0
  • Just curious if this issue has been addressed, and if so, when to expect an update? I would love to take out the code for removing and re-appending of an image to colorize it properly.
    0

Recent Posts

in Design / Interaction - Yahoo! TV Widgets