RSS/Atom feed Twitter
Site is read-only, email is disabled

obtain a Windows DIB handle to a GIMP selection

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

obtain a Windows DIB handle to a GIMP selection Lucian Sabo 06 Oct 10:55
  obtain a Windows DIB handle to a GIMP selection Martin Nordholts 06 Oct 21:25
  obtain a Windows DIB handle to a GIMP selection Sven Neumann 06 Oct 21:48
Lucian Sabo
2009-10-06 10:55:15 UTC (over 15 years ago)

obtain a Windows DIB handle to a GIMP selection

Hello all,

I want to create a plugin for Windows only that makes use of a windows DLL. The function from the DLL I need to call requires a DIB Handle as parameter and the original file name. I did not found any method to get active selection as Windows DIB HANDLE.

If not familiar with Windows DIBs, here is a link http://www.herdsoft.com/ti/davincie/imex3j8i.htm

Do you have a sample source code in C for this ? I assume there is a way to get a pointer to the RGBA pixel data with all layers combined.

Thank you Lucian

Martin Nordholts
2009-10-06 21:25:08 UTC (over 15 years ago)

obtain a Windows DIB handle to a GIMP selection

On 10/06/2009 10:55 AM, Lucian Sabo wrote:

Hello all,

I want to create a plugin for Windows only that makes use of a windows DLL. The function from the DLL I need to call requires a DIB Handle as parameter and the original file name. I did not found any method to get active selection as Windows DIB HANDLE.

Hi,

Should work to get the active selection using gimp_image_get_selection() [1] and then create a DIB from that using pixel data fetched with e.g. GimpPixelRgn [2]

/ Martin

[1] http://developer.gimp.org/api/2.0/libgimp/libgimp-gimpimage.html#gimp-image-get-selection [2] http://developer.gimp.org/api/2.0/libgimp/libgimp-gimppixelrgn.html

Sven Neumann
2009-10-06 21:48:12 UTC (over 15 years ago)

obtain a Windows DIB handle to a GIMP selection

On Tue, 2009-10-06 at 11:55 +0300, Lucian Sabo wrote:

Do you have a sample source code in C for this ? I assume there is a way to get a pointer to the RGBA pixel data with all layers combined.

If you need the data from all layers combined, then you can use gimp_layer_new_from_visible () to create a temporary layer that your plug-in can then read the pixel data from.

How to access pixel data from a plug-in is explained in http://developer.gimp.org/writing-a-plug-in/2/

Sven