comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: convert read_bpm(file, R, G, B) to N x M x 3 array?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: convert read_bpm(file, R, G, B) to N x M x 3 array? [message #52754] Thu, 01 March 2007 09:45 Go to previous message
Mike[2] is currently offline  Mike[2]
Messages: 99
Registered: December 2005
Member
On Mar 1, 4:04 am, Wox <nom...@hotmail.com> wrote:
> You know you could do this right?
> button=widget_button(base,value=filename,/bitmap)

I know that, but I'm experimenting with converting my bitmaps
to functions that return the bitmaps with the idea that it
might result in more portable code.

> Why not just using this:
> result=read_bmp(filename)
> This will give a 3xNxM, so you can use this to get NxMx3:
> result=transpose(result,[1,2,0])

That doesn't work with all bitmaps. READ_BMP returns an NxM
array for a single channel bitmap.

Mike



IDL> tmp = query_bmp('smaller.bmp', info)
IDL> help, info, /str
** Structure <844d21c>, 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'
IDL> help, read_bmp('smaller.bmp')
<Expression> BYTE = Array[24, 24]



IDL> tmp = query_bmp('alpha_left.bmp', info)
IDL> help, info, /str
** Structure <844bfc4>, 7 tags, length=40, data length=36, refs=1:
CHANNELS LONG 3
DIMENSIONS LONG Array[2]
HAS_PALETTE INT 0
NUM_IMAGES LONG 1
IMAGE_INDEX LONG 0
PIXEL_TYPE INT 1
TYPE STRING 'BMP'
IDL> help, read_bmp('alpha_left.bmp')
<Expression> BYTE = Array[3, 11, 11]
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: personal license problem
Next Topic: IDL Online help-- Windows-- Favorites

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 10:52:18 PDT 2025

Total time taken to generate the page: 0.16060 seconds