Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT, image creation

Status
Not open for further replies.

edwong

Programmer
Mar 26, 2003
30
US
I tried to set up a image in my interface
by keep getting compile error saying ds.bitmap is in wrong format

Here is my script in tk

set im [image create bitmap -file ds.bitmap -maskfile ds.mask]
button .top -image $im

what's the problem?

do i need any event handler in my c++ program?
if yes, how to use?
 
A bitmap in Tcl is bascially black and white. "A bitmap is an image whose pixels can display either of two colors or be transparent. A bitmap image is defined by four things: a background color, a foreground color, and two bitmaps, called the source and the mask. Each of the bitmaps specifies 0/1 values for a rectangular array of pixels, and the two bitmaps must have the same dimensions. For pixels where the mask is zero, the image displays nothing, producing a transparent effect. For other pixels, the image displays the foreground color if the source data is one and the background color if the source data is zero." Is that the format you're using. I generally use GIF's for color images using "image create ...":
image create photo i1 -file h:/pix/

Bob Rashkin
rrashkin@csc.com
 
I did the following

image create photo i1 -file ./ds.gif

and it compiles

but the image doesn't show up

where should i put it so that it will show up?

thx
 
I don't know why that should be, you may need to fiddle with the size of the image:
-height $h -width $w

That's all I've ever done. Bob Rashkin
rrashkin@csc.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top