BMP on widget_buttons [message #68271] |
Fri, 16 October 2009 12:26  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Hi guys,
Widget_buttons only accept bmp images so if I want a button with a jpg
image (for example) I've to convert it to BMP. I try to do that and my
final BMP has the following definition:
image=read_bmp('import.bmp', r, g, b)
help, image, r, g, b
IMAGE BYTE = Array[16, 16]
R BYTE = Array[256]
G BYTE = Array[256]
B BYTE = Array[256]
test=QUERY_BMP('import.bmp', info)
help, info, /str
** Structure <da333dc>, 7 tags, length=40, data length=36, refs=1:
CHANNELS LONG 1
DIMENSIONS LONG Array[2]
HAS_PALETTE INT 1
NUM_IMAGES LONG 1
IMAGE_INDEX LONG 0
PIXEL_TYPE INT 1
TYPE STRING 'BMP'
All of that seems ok but when I try to create the button I've an
error:
% WIDGET_BUTTON: Can't open bitmap file: import.bmp
I don't know why this errors happen. When I try to open original BMP
files that has the same definition, the button can be created so I'm
very confused.
Does somebode help me?
Regards,
nata
|
|
|
Re: BMP on widget_buttons [message #68354 is a reply to message #68271] |
Mon, 19 October 2009 08:43  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
I always have "problems" with the coyote humor. It's hard for me... I
prefer other kinds of humor, like frog's humor or rabbit's humor but
it's all ok, it helps me to get good answers to my strange questions.
Cheers,
nata
|
|
|
Re: BMP on widget_buttons [message #68356 is a reply to message #68271] |
Mon, 19 October 2009 08:37  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Nice sense of humor but the "partial" solution works on WINDOWS, MAC
and LINUX so I don't see the problem. I know that we have to be treat
the paths carefully in IDL but I was just talking about the bmp paths
for a widget_button.
Thanks for your help anyway teacher :)
nata
|
|
|
Re: BMP on widget_buttons [message #68357 is a reply to message #68271] |
Mon, 19 October 2009 08:16  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> nata writes:
>
>> Normally, I use paths like: button_file = './resources/
>> mybuttonfile.bmp'
>> And always works fine.
>
> Well, on your machine and machines like it, I guess. :-)
I was trying to gently prod you toward the general solution,
rather than the partial solution you have here. They say
the teacher appears when the student is ready. I don't know
what happens when the teacher appears *before* the student
is ready. He probably loses his IEPA card. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: BMP on widget_buttons [message #68358 is a reply to message #68271] |
Mon, 19 October 2009 07:59  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
nata writes:
> Normally, I use paths like: button_file = './resources/
> mybuttonfile.bmp'
> And always works fine.
Well, on your machine and machines like it, I guess. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: BMP on widget_buttons [message #68360 is a reply to message #68271] |
Mon, 19 October 2009 07:52  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Normally, I use paths like: button_file = './resources/
mybuttonfile.bmp'
And always works fine.
I was just testing some created bmp files.
Regards,
nata
|
|
|
Re: BMP on widget_buttons [message #68362 is a reply to message #68271] |
Mon, 19 October 2009 07:10  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
nata writes:
> I didn't expect this kind of error. I see... I never have to write the
> paths like '~/Desktop/' mhuahahahah
Well, neither do I. I use paths like this:
buttonFile = Filepath(RootDir=ProgramRootDir(), $
SubDirectory='resources', 'mybuttonfile.bmp')
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: BMP on widget_buttons [message #68365 is a reply to message #68271] |
Mon, 19 October 2009 06:15  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
nata writes:
>
> YES !
Well, then, I would try an absolute path name to the
file instead of a relative path name.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|