🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2267

Re: Bitmap dimensions

#2267
From: Ed McCreary
Date: Fri, 22 Jan 1993 14:44
23 lines
1305 bytes
>>>>> On Fri, 22 Jan 1993 12:00:14 GMT, martijn@cs.vu.nl (Lemmens ML) said:


LM> Is it possible to retrieve the dimensions of a bitmap in a windows
LM> resource file. I can use constants because I draw the bitmap myself,
LM> but I want my program to work independent of the drawings. I know how
LM> to load the resource and how to display it.

try this...

BITMAP	Bitmap;
HBITMAP hBitmap;

hBitmap = LoadBitmap(hInst,(LPSTR)"bitmap_id");
GetObject (hBitmap, sizeof (Bitmap), (LPSTR) &Bitmap);


your width and height are Bitmap.bmWidth and Bitmap.bmHeight.

--
Ed McCreary                                               ,__o
edm@gocart.eng.hou.compaq.com                           _-\_<,
"If it were not for laughter, there would be no Tao."  (*)/'(*)
Technical Details
Message-ID: <EDM.93Jan22094455@gocart.twisto.compaq.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!wotan.compaq.com!twisto.eng.hou.compaq.com!twisto!edm
References: <C1980F.HEz@cs.vu.nl>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!wotan.compaq.com!twisto.eng.hou.compaq.com!twisto!edm
From: edm@gocart.twisto.compaq.com (Ed McCreary)
Subject: Re: Bitmap dimensions
In-Reply-To: martijn@cs.vu.nl's message of Fri, 22 Jan 1993 12: 00:14 GMT
Message-ID: <EDM.93Jan22094455@gocart.twisto.compaq.com>
Sender: news@twisto.eng.hou.compaq.com (Netnews Account)
Organization: Compaq Computer Corp
References: <C1980F.HEz@cs.vu.nl>
Date: Fri, 22 Jan 1993 14:44:55 GMT
Lines: 23