On 14.05.2010, at 18:23, <[email protected]> <[email protected]> wrote:
> I was wondering if anyone knew how to redraw after altering the pixel array
> in fltk, basically, I have:
> ..
> Fl_JPEG_Image jpg("logo.jpg");
> ..
> for(int i=0; i!=jpg.h()*jpg.w(); i++){
> ((uchar*)jpg.array)[3*i+1]=0;
> ((uchar*)jpg.array)[3*i+2]=0;
> }
> UI.ImageBox->set_changed();
> UI.ImageBox->redraw();
>
> I'm trying to only get the blue color to show up. I know that this change is
> registering, because when I do the desaturation, it gets darker when I first
> run it through this.
>
> Any tips would be much appreciated!
Look at Fl_RGB_Image.cxx, specifically at the "desaturate" code. You already
tried it and know that it works. There are a few tricks involved, but basically
you need to "uncache" the device dependent bitmap, so that a new cache is
generated the next time the image is drawn.
The simplest would be to copy Fl_RGB_Image::desaturate and modify the code to
your needs.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk