On 14 May 2010, at 17: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!

There's a HowTo that covers similar ground.

http://www.fltk.org/articles.php?L468

To be honest, and depending on what it is you need to do with your  
image data, I'm not sure I'd bother with Fl_JPEG_Image if I was going  
to tweak the data a lot - just read it in (probably use  
Fl_Shared_Image or similar for that, since it can handle multiple  
file formats) then use my own pixel map to manipulate and display the  
data.


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to