1. Win32Lib - Bitmap's Size

Hi all,
     I just wanted to know how I get the size from a bitmap file
without drawing it. Or maybe a procedure to move a bitmap?

Thanks,
     Red Knight

__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

new topic     » topic index » view message » categorize

2. Re: Win32Lib - Bitmap's Size

On Tue, 3 Oct 2000 12:52:38 -0700, Caballero Rojo wrote:

>Hi all,
>     I just wanted to know how I get the size from a bitmap file
>without drawing it.

No problem:  you can use 'loadBitmapFromFile' to get the handle then
use 'getSize' or 'getExtent' to get the dimensions (I assume that's what
you mean by "size").

Example:

atom bmp
sequence bmp_size, bmp_extent

bmp = loadBitmapFromFile( "mybitmap.bmp" )

bmp_size = getSize( bmp )   -- returns {0,0,width,height}
bmp_extent = get_extent( bmp ) -- returns {width,height}


>Or maybe a procedure to move a bitmap?

You could use a bitmap control, put your bitmap into it, then move the
control.  Or you could 'copyBlt' your bitmap wherever you'd like...

-- Brian

new topic     » goto parent     » topic index » view message » categorize

3. Re: Win32Lib - Bitmap's Size

Hi,
you can use getExtent() to find the size of the bitmap, and moveWindow() to
move it.

---------------------
  constant Repaint = 1
  atom     hBitmap
  integer  BitmapID
  sequence Dimensions

  hBitmap    = loadBitmapFromFile("whatever.bmp")
  Dimensions = getExtent(hBitmap)
  BitMapID   = create(Bitmap, "" , aWindow, x, y, Dimensions[1],
Dimensions[2], 0)
  . . .
  moveWindow(BitMapID, newx, newy, Dimensions[1], Dimensions[2], Repaint)
---------------------


cheers,
Derek Parnell

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu