bj@oak.UUCP (Bjoren Davis) (05/18/91)
Here's another question for y'all: How can I determine how much space I should allocate for XImage data before I call XCreateImage? It seems that that is the kind of thing that would be well hidden in Xlib. Thanks. --Bjoren Davis (bj@oak.com) Oakland Group, Inc.
killy@fibronics.UUCP (Kirill Tatarinoff) (05/21/91)
In article <9105171919.AA02397@oak.com>, bj@oak.UUCP (Bjoren Davis) writes: > > How can I determine how much space I should allocate for XImage data before > I call XCreateImage? It seems that that is the kind of thing that would be > well hidden in Xlib. There is nothing hidden here. This size just depends on Image's format. For XYBitmap You may want to allocate the space by smth like: calloc((width / 8) + (width % 8 ? 1 : 0), height) and for ZPixmap: malloc(width * height * (image->bits_per_pixel / 8)) and so on ... -- _____________________________________________________________________ Kirill Tatarinoff | "Those evening bells! those evening bells! killy@fibronics.UUCP | How many a tale their music tells... " Nms Team | Thomas Moore Fibronics International, | Israel | ---------------------------------------------------------------------