manipulating GdkBitmaps

manipulating GdkBitmaps

Post by Fabien Derrea » Wed, 07 Mar 2001 17:06:00



Hi

I'm working on some gtk program which uses bmp skin
I can take the bmp file and translate it to a GdkPixmap and a GdkBitmap
represeting the image and the mask.

now, my pixmap is made of several images put together ( a 200x10 pixmap for
20 10x10 images)
I can cut the pixmap in pieces using gdk_pixmap_draw, but i didn't found
anything for the bitmap

Can anyone give me a hint?

thanx

Fabien derreal

 
 
 

manipulating GdkBitmaps

Post by Victor Wagn » Thu, 08 Mar 2001 15:27:29



: Hi

: I'm working on some gtk program which uses bmp skin
: I can take the bmp file and translate it to a GdkPixmap and a GdkBitmap
: represeting the image and the mask.

: now, my pixmap is made of several images put together ( a 200x10 pixmap for
: 20 10x10 images)
: I can cut the pixmap in pieces using gdk_pixmap_draw, but i didn't found
: anything for the bitmap

Are you sure that GdkBitmap is the thing you want?
You are talkink about bmp files, which typically are not monochrome.

In X11 Bitmaps usilly mean _bit_ maps, i.e. thing where pixel can be
either on or off. On Windows they misleadingly call any raster graphic
bitmap, when in X11 it is more accurately called Pixmap.

So, you typically lose nothing but some amount of memory and CPU time
if you use Pixmap, where Bitmap is enough. But if you program on Gtk,
you shouldn't worry about performance and resource consuming.

If you worry about it, you should at first look to normal X11 graphic
toolkit.

--
Photographing a volcano is just about the most miserable thing you can do.
                -- Robert B. Goodman
        [Who has clearly never tried to use a PDP-10.  Ed.]

 
 
 

manipulating GdkBitmaps

Post by Jason Rosinski - mr » Fri, 09 Mar 2001 23:08:13




> : Hi

> : I'm working on some gtk program which uses bmp skin
> : I can take the bmp file and translate it to a GdkPixmap and a GdkBitmap
> : represeting the image and the mask.

> : now, my pixmap is made of several images put together ( a 200x10 pixmap for
> : 20 10x10 images)
> : I can cut the pixmap in pieces using gdk_pixmap_draw, but i didn't found
> : anything for the bitmap

> Are you sure that GdkBitmap is the thing you want?
> You are talkink about bmp files, which typically are not monochrome.

> In X11 Bitmaps usilly mean _bit_ maps, i.e. thing where pixel can be
> either on or off. On Windows they misleadingly call any raster graphic
> bitmap, when in X11 it is more accurately called Pixmap.

> So, you typically lose nothing but some amount of memory and CPU time
> if you use Pixmap, where Bitmap is enough. But if you program on Gtk,
> you shouldn't worry about performance and resource consuming.

> If you worry about it, you should at first look to normal X11 graphic
> toolkit.

> --
> Photographing a volcano is just about the most miserable thing you can do.
>                 -- Robert B. Goodman
>         [Who has clearly never tried to use a PDP-10.  Ed.]

        Hey, do you guys know how to create a GdkPixmap from an XPixmap?  I'm
trying to do some graphics work as a home hobby and I'd like to use GDK
to simplify all the window design elements.  However, GDK only seems to
allow creation of a GdkPixmap from either XPM, Bitmaps or some weird
data format (which doesn't seem to be specified all that well).  Is
there a way to just create an off-screen Pixmap with Xlib, and pass it
to GDK?
--
Jason Rosinski
Mitel Semiconductor

 
 
 

manipulating GdkBitmaps

Post by Fabien Derrea » Wed, 14 Mar 2001 17:00:03


Of course I'm using a Pixmap to store the image.
My problem comes with the Bitmap mask. typically, I'm using a color
(255,0,255) to set which pixels are not to be colored at all, wich I
translate into a bitmap mask
 Then the problem comes when I try to cut this bitmap mask into slices.





: Hi

: I'm working on some gtk program which uses bmp skin
: I can take the bmp file and translate it to a GdkPixmap and a GdkBitmap
: represeting the image and the mask.

: now, my pixmap is made of several images put together ( a 200x10 pixmap
for
: 20 10x10 images)
: I can cut the pixmap in pieces using gdk_pixmap_draw, but i didn't found
: anything for the bitmap

Are you sure that GdkBitmap is the thing you want?
You are talkink about bmp files, which typically are not monochrome.

In X11 Bitmaps usilly mean _bit_ maps, i.e. thing where pixel can be
either on or off. On Windows they misleadingly call any raster graphic
bitmap, when in X11 it is more accurately called Pixmap.

So, you typically lose nothing but some amount of memory and CPU time
if you use Pixmap, where Bitmap is enough. But if you program on Gtk,
you shouldn't worry about performance and resource consuming.

If you worry about it, you should at first look to normal X11 graphic
toolkit.

--
Photographing a volcano is just about the most miserable thing you can do.
-- Robert B. Goodman
[Who has clearly never tried to use a PDP-10.  Ed.]

 
 
 

manipulating GdkBitmaps

Post by Fabien Derrea » Wed, 14 Mar 2001 17:54:37


I use the x11amp bmp.c file.
It creates a guchar table of size w*h*3, and endodes the image as a RGB
mapping
the it uses the gdk_draw_rgb_image function to put it into a Pixmap.

guchar *data,r,g,b;
register guchar *ptr;
data=(guchar *)g_malloc0(w*3*h);
*ptr++=r;
*ptr++=g;
*ptr++=b;

gdk_draw_rgb_image(ret,bmp_gc,0,0,w,h,GDK_RGB_DITHER_MAX,data,w*3);




> In comp.os.linux.development.apps Fabien Derreal

> : Hi

> : I'm working on some gtk program which uses bmp skin
> : I can take the bmp file and translate it to a GdkPixmap and a GdkBitmap
> : represeting the image and the mask.

> : now, my pixmap is made of several images put together ( a 200x10 pixmap
for
> : 20 10x10 images)
> : I can cut the pixmap in pieces using gdk_pixmap_draw, but i didn't found
> : anything for the bitmap

> Are you sure that GdkBitmap is the thing you want?
> You are talkink about bmp files, which typically are not monochrome.

> In X11 Bitmaps usilly mean _bit_ maps, i.e. thing where pixel can be
> either on or off. On Windows they misleadingly call any raster graphic
> bitmap, when in X11 it is more accurately called Pixmap.

> So, you typically lose nothing but some amount of memory and CPU time
> if you use Pixmap, where Bitmap is enough. But if you program on Gtk,
> you shouldn't worry about performance and resource consuming.

> If you worry about it, you should at first look to normal X11 graphic
> toolkit.

> --
> Photographing a volcano is just about the most miserable thing you can do.
>                 -- Robert B. Goodman
>         [Who has clearly never tried to use a PDP-10.  Ed.]

Hey, do you guys know how to create a GdkPixmap from an XPixmap?  I'm
trying to do some graphics work as a home hobby and I'd like to use GDK
to simplify all the window design elements.  However, GDK only seems to
allow creation of a GdkPixmap from either XPM, Bitmaps or some weird
data format (which doesn't seem to be specified all that well).  Is
there a way to just create an off-screen Pixmap with Xlib, and pass it
to GDK?
--
Jason Rosinski
Mitel Semiconductor

 
 
 

1. manipulating gdkbitmap

Hi

I'm working on some gtk program which uses bmp skin
I can take the bmp file and translate it to a GdkPixmap and a GdkBitmap
represeting the image and the mask.

now, my pixmap is made of several images put together ( a 200x10 pixmap for
20 10x10 images)
I can cut the pixmap in pieces using gdk_pixmap_draw, but i didn't found
anything for the bitmap

Can anyone give me a hint?

thanx

Fabien derreal

2. New info about Linux on IBM Thinkpad 600E.

3. A good program for manipulating partitions ?

4. Type 3 fonts with acroread

5. manipulating device numbers to prevent stale NFS handles?

6. Connecting to ORACLE Database

7. manipulating "from" field in an email

8. file name from upper case to lower case.. pls hlp

9. ** Q: HOW TO MANIPULATE STRINGS IN A FILE WITH A LISP FUNCTION **

10. manipulating dates in C

11. How does one implement and manipulate shared memory?

12. Manipulating TCP traffic

13. Lines in display when manipulating window?? HELP!!