Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!samsung!olivea!uunet!imp!fibronics!killy From: killy@fibronics.UUCP (Kirill Tatarinoff) Newsgroups: comp.windows.x Subject: Re: Question about XImage s Summary: Re: Question about XImage size Message-ID: <320@ariadna.fibronics.UUCP> Date: 21 May 91 06:06:26 GMT References: <9105171919.AA02397@oak.com> Organization: Fibronics International Inc., Haifa - Israel Lines: 21 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 | ---------------------------------------------------------------------