Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fail to create pixmap with Tk_GetPixmap in ImgPhotoInstanceSetSize

3,213 views
Skip to first unread message

Jessi

unread,
Jan 27, 2004, 10:55:29 AM1/27/04
to
hi,

after creating a lot of photo images i get following error message:

"Fail to create pixmap with Tk_GetPixmap in ImgPhotoInstanceSetSize"

i found this error message in the file:

tkImgPhoto.c (ImgPhotoInstanceSetSize(instancePtr))

and as far as i understand, it somehow seems that CreateBitmap
(invoked by the Tk_GetPixmap in tkWinPixmap.c) fails, which means that
i am running out of bitmap handles?

any work arround available? any bug fixes? any help?

it's a major problem for me at the moment.. so i am happy for any kind
of hints!

jessi

Georgios Petasis

unread,
Jan 28, 2004, 2:27:51 PM1/28/04
to
What is the number of images you already have allocated?
What is their width/height (just to get an idea of the required memory).
Do you need all of these images loaded at once?
Perhaps you have run out memory? (Windows will never allow an app
to take more than 600MB :-))

George

"Jessi" <jess...@yahoo.de> wrote in message
news:1d944ba3.04012...@posting.google.com...

Jessi

unread,
Jan 29, 2004, 6:58:41 AM1/29/04
to
hi,

thx george for replying...

i forgot to tell, that i am also using the "image create compound"
command from tix.

so:

"Georgios Petasis" <pet...@iit.demokritos.gr> wrote in message news:<bv92fs$g8j$1...@ulysses.noc.ntua.gr>...


> What is their width/height (just to get an idea of the required memory).

the size is different (eg. 64 x 64, 130 x 30 or even 153 x 113)

but for example: size 153 x 113, number of compound images allocated:
about 900 and it crashes with "Fail to create pixmap with Tk_GetPixmap
in ImgPhotoInstanceSetSize"

compound images: icon + name of the file put underneath


> Do you need all of these images loaded at once?

yes, because it can happen, that there are e.g. 1200 files in one
folder, and we show the files as icons..

> Perhaps you have run out memory? (Windows will never allow an app
> to take more than 600MB :-))
>


i wrote a little test program:

set frame [frame .frame]

set width 200
set height 200

for { set i 0 } { $i < 7000 } { incr i } {

image create photo $i -width $width -height $height

set tmp [image create compound COMP_$i -window $frame]

$tmp add image -image $i
$tmp add line -anchor center
$tmp add text -text $i

update idletasks
puts "i $i"
}

result:

789 images and compound images were created ==> then crash with this
error

but trying:

set width 200
set height 200

for { set i 0 } { $i < 7000 } { incr i } {

image create photo $i -width $width -height $height

image create photo test_$i -width $width -height [expr $height + 10]
update idletasks
puts "i $i"
}

result:

2269 images were created => crash with "not enough memory in image
buffer" ==> but with that result i can live!


so it seems to be a problem in the "image create compound" command?

using:
tix8.1.4
itcl3.2
tcl8.4.2
tk8.4.2

anyone out there who has experience with that? or a solution?

if not, then i will have to chuck out the "image create compound", and
create the icon with the filename underneath on my own..
that will maybe do it..

jessi

Georgios Petasis

unread,
Jan 31, 2004, 4:52:22 AM1/31/04
to
Can you explain what your code tries to do?
You try to write something like a thumbnail preview
in a folder? Creating thumbnails for all files in there is not
a right approach :-) Even windows explorer creates
the images as you browse them.
Anyway, it would be nice to know what you are after.
I am not familiar with the tix extension. The "icon" you
describe in image compound is a small thumbnail
of the larger image, or a windows icon that can be used in toplevel
decoration?

George

"Jessi" <jess...@yahoo.de> wrote in message
news:1d944ba3.04012...@posting.google.com...

0 new messages