home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / pascal / 8620 < prev    next >
Encoding:
Text File  |  1993-01-28  |  2.6 KB  |  87 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!munnari.oz.au!sgiblab!spool.mu.edu!darwin.sura.net!newsserver.jvnc.net!gmd.de!gmd.de!focke
  3. From: focke@gmd.de (Stefan Focke)
  4. Subject: Re: TPW: How to get a pointer from a handle
  5. Message-ID: <focke.158.728131988@gmd.de>
  6. Sender: news@gmd.de (USENET News)
  7. Nntp-Posting-Host: novell2
  8. Organization: gmd
  9. References: <focke.154.728048555@gmd.de> <9ysZXB1w165w@falcon.no>
  10. Date: Wed, 27 Jan 1993 10:53:08 GMT
  11. Lines: 74
  12.  
  13. In article <9ysZXB1w165w@falcon.no> lfosdal@falcon.no (Lars Fosdal) writes:
  14. >From: lfosdal@falcon.no (Lars Fosdal)
  15. >Subject: Re: TPW: How to get a pointer from a handle
  16. >Date: Tue, 26 Jan 93 18:29:07 MET
  17. >focke@gmd.de (Stefan Focke) writes:
  18. >
  19. >> If I create a brush or a bitmap I get its handle. Is it possible to find the 
  20. >> address where this brush or bitmap is realy stored. 
  21. >
  22. >This is one for the FAQ!
  23. >
  24. >Assuming you've got a valid handle (hBM):
  25. >VAR
  26. > hBM : hBitMap;
  27. > BM : TBitMap; {Lots of nice info in this one...}
  28. >BEGIN
  29. >  .
  30. >  hBM gets a valid handle
  31. >  .
  32. >  :
  33. >  IF GetObject(hBM, SizeOf(TBitMap), @BM)<>0
  34. >  THEN BEGIN {We've got a valid bitmap)
  35. >  
  36. >    BM.bmBits now points to the bitmap bits.
  37. >  
  38. >  END;
  39. >
  40. >
  41. >Also, Check out the Set/GetBitmapBits functions (WinProcs).
  42. >
  43. >
  44. >Lars F.
  45. >--
  46. >/ Mr.Lars Fosdal              / Falcon AS            / lfosdal@falcon.no  /
  47. >/ Software Developer          / Stranden 1           / Tel. +47 22831310  /
  48. >/ Financial Analysis Systems  / N-0250 OSLO, Norway  / Fax. +47 22831290  /
  49. >----=* All opinions are personal and does not reflect company policy *=----
  50.  
  51. 1)
  52.      
  53. Ok, I tried this:
  54.  
  55.      PDC:= getDC(HWindow);
  56.      hDCBufBitmap:=  CreateCompatibleDC(PDC);
  57.      hBufBitmap:=    CreateCompatibleBitmap(PDC, 1000, 600);
  58.      hOldBufBitmap:= SelectObject(hDCBufBitmap, hBufBitmap);
  59.      i:= GetObject(hBufBitmap, SizeOf(TBitmap), @BM);
  60.  
  61.  
  62. What I want is the address of the pixels of the bitmap.
  63.  
  64.      i = 14
  65.      BM.bmBits = nil
  66.  
  67. So, this function does not help.
  68.  
  69. 2)  GetObject with a TLogBrush-parameter has no address entry.
  70.  
  71. 3)  I need a fast output of colored rectangels. PatBlt seems to be the 
  72.     fastes GDI-function. But it is not fast enough. So I would like to write 
  73.     directly to memory. I try serveral possiblities, for example bitmaps. 
  74.     Writing into a buffer and transfering it with SetBitmapBits to the 
  75.     bitmap is to slow. I would like to write directly to bitmap-memory. 
  76.  
  77.  Thank you
  78. Stefan 
  79.  
  80. ----------------------------------------------------------------------
  81.  
  82. Stefan Focke                  Tel. 02241-14-3154
  83. GMD-I8                        e-mail: stefan.focke@gmd.de
  84. Postfach 1316
  85. D-W 5205 Sankt Augustin 1            
  86.