home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!munnari.oz.au!sgiblab!spool.mu.edu!darwin.sura.net!newsserver.jvnc.net!gmd.de!gmd.de!focke
- From: focke@gmd.de (Stefan Focke)
- Subject: Re: TPW: How to get a pointer from a handle
- Message-ID: <focke.158.728131988@gmd.de>
- Sender: news@gmd.de (USENET News)
- Nntp-Posting-Host: novell2
- Organization: gmd
- References: <focke.154.728048555@gmd.de> <9ysZXB1w165w@falcon.no>
- Date: Wed, 27 Jan 1993 10:53:08 GMT
- Lines: 74
-
- In article <9ysZXB1w165w@falcon.no> lfosdal@falcon.no (Lars Fosdal) writes:
- >From: lfosdal@falcon.no (Lars Fosdal)
- >Subject: Re: TPW: How to get a pointer from a handle
- >Date: Tue, 26 Jan 93 18:29:07 MET
- >focke@gmd.de (Stefan Focke) writes:
- >
- >> If I create a brush or a bitmap I get its handle. Is it possible to find the
- >> address where this brush or bitmap is realy stored.
- >
- >This is one for the FAQ!
- >
- >Assuming you've got a valid handle (hBM):
- >VAR
- > hBM : hBitMap;
- > BM : TBitMap; {Lots of nice info in this one...}
- >
- >BEGIN
- > .
- > hBM gets a valid handle
- > .
- > :
- > IF GetObject(hBM, SizeOf(TBitMap), @BM)<>0
- > THEN BEGIN {We've got a valid bitmap)
- >
- > BM.bmBits now points to the bitmap bits.
- >
- > END;
- >
- >
- >Also, Check out the Set/GetBitmapBits functions (WinProcs).
- >
- >
- >Lars F.
- >--
- >/ Mr.Lars Fosdal / Falcon AS / lfosdal@falcon.no /
- >/ Software Developer / Stranden 1 / Tel. +47 22831310 /
- >/ Financial Analysis Systems / N-0250 OSLO, Norway / Fax. +47 22831290 /
- >----=* All opinions are personal and does not reflect company policy *=----
-
- 1)
-
- Ok, I tried this:
-
- PDC:= getDC(HWindow);
- hDCBufBitmap:= CreateCompatibleDC(PDC);
- hBufBitmap:= CreateCompatibleBitmap(PDC, 1000, 600);
- hOldBufBitmap:= SelectObject(hDCBufBitmap, hBufBitmap);
- i:= GetObject(hBufBitmap, SizeOf(TBitmap), @BM);
-
-
- What I want is the address of the pixels of the bitmap.
-
- i = 14
- BM.bmBits = nil
-
- So, this function does not help.
-
- 2) GetObject with a TLogBrush-parameter has no address entry.
-
- 3) I need a fast output of colored rectangels. PatBlt seems to be the
- fastes GDI-function. But it is not fast enough. So I would like to write
- directly to memory. I try serveral possiblities, for example bitmaps.
- Writing into a buffer and transfering it with SetBitmapBits to the
- bitmap is to slow. I would like to write directly to bitmap-memory.
-
- Thank you
- Stefan
-
- ----------------------------------------------------------------------
-
- Stefan Focke Tel. 02241-14-3154
- GMD-I8 e-mail: stefan.focke@gmd.de
- Postfach 1316
- D-W 5205 Sankt Augustin 1
-