On 19 Mar 2012, at 14:43, Edzard Egberts wrote:

> Ian MacArthur schrieb:
>> 
>> On 19 Mar 2012, at 13:34, Edzard Egberts wrote:
>> What I did was just read back the data from the offscreen, repack it as RGB, 
>> then write it to a PNG using the stock PNG API directly.
>> 
>> Getting the data out was done as per this howto:
>> 
>>     http://www.fltk.org/articles.php?L468
> 
> Is this the right link - "Display Arbitrary Data as an Image"? I don't 
> understand, what this should tell me, because my problem is to get the 
> Fl_Offscreen image array and I didn't found Fl_Offscreen mentioned at all:


Sorry - I think you have misunderstood my intent; if you have the data, and I 
took to from your original post that you did, then that howto demonstrates how 
to get the data pointer you need to recover and store the image. The offscreen 
surface is not necessary - though can help.

If you do go the offscreen route, the "solution" is to make the offscreen 
current then use fl_read_image(...); to get the raw data.

There was a thread about this a while back, and I posted some examples... Um... 
maybe about here'ish;

      http://www.fltk.org/newsgroups.php?gfltk.general+v:27474



> 
>>> ./FL/win32.H:134:typedef HBITMAP Fl_Offscreen;
>>> ./FL/x.H:95:typedef ulong Fl_Offscreen;
> 
> There is a HBITMAP and ulong, how can I use this to get the image array? 
> It's the part "just read back and repack". ;o)

That, more or less, is what I meant with the link to the howto - you can use 
the fltk mechanisms to get the data in the same "fltk" format regardless of 
platform, you don't need to grok the underlying implementation.




_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to