Board index » delphi » BITS -> BITMAP

BITS -> BITMAP

Excuse my English i am a French

I want a pointer to bits of Bitmap for direct
modification of this bits and to look the modification
directly on a screen.

Can you help me.
a example of program is very apprecied.

THANK YOU.

Gausi Eric.

 

Re:BITS -> BITMAP


In article <3177998B.7...@obspm.fr>, eric.ga...@obspm.fr says...
Quote

>Excuse my English i am a French

>I want a pointer to bits of Bitmap for direct
>modification of this bits and to look the modification
>directly on a screen.

>Can you help me.
>a example of program is very apprecied.

>THANK YOU.

>Gausi Eric.

Hello Eric,
how about using GETBITMAPBITS from the Windows API?!

function GetBitmapBits(Bitmap: HBitmap; Count: LongInt; Bits: Pointer):
LongInt;

then carry out your modifications, call CREATEDIBITMAP

function CreateDIBitmap(DC: HDC; var InfoHeader: TBitmapInfoHeader; dwUsage:
LongInt; InitBits: PChar; var InitInfo: TBitmapInfo; wUsage: Word): HBitmap;

and finally BITBLT it to your DC!

function BitBlt(DestDC: HDC; X, Y, nWidth, Height: Integer; SrcDC: HDC;
  XSrc, YSrc: Integer; Rop: LongInt): Bool;

Cheers Christian

--
-------------------------------------------------------------------------------
| Christian Braun                                    | TTTTT U   U            |
| Iwan-N.-Stranski-Institut der TU Berlin            |   T   U   U            |
| Sekr. ER 1                                         |   T   U   U            |
| Strasse des 17. Juni 112                           |   T   U   U            |
| D-10623 Berlin                                     |   T    UUU   Berlin    |
|                                                    -------------------------|

|                                                                             |
|http://webwork.zrz.tu-berlin.de/~insi/ag_findenegg/Christian/christia...  |
-------------------------------------------------------------------------------

Re:BITS -> BITMAP


In Delphi 2.0, use the Win32 api CreateDIBSection, and assign the
bitmap handle it returns to a TBitmap object.  You can then access and
modify the pixel bits in memory without having to destroy and recreate
the bitmap handle.

-Danny

Quote
chri0...@mailszrz.zrz.tu-berlin.de (Christian Braun) wrote:
>In article <3177998B.7...@obspm.fr>, eric.ga...@obspm.fr says...

>>Excuse my English i am a French

>>I want a pointer to bits of Bitmap for direct
>>modification of this bits and to look the modification
>>directly on a screen.

>>Can you help me.
>>a example of program is very apprecied.

>>THANK YOU.

>>Gausi Eric.
>Hello Eric,
>how about using GETBITMAPBITS from the Windows API?!
>function GetBitmapBits(Bitmap: HBitmap; Count: LongInt; Bits: Pointer):
>LongInt;
>then carry out your modifications, call CREATEDIBITMAP
>function CreateDIBitmap(DC: HDC; var InfoHeader: TBitmapInfoHeader; dwUsage:
>LongInt; InitBits: PChar; var InitInfo: TBitmapInfo; wUsage: Word): HBitmap;
>and finally BITBLT it to your DC!
>function BitBlt(DestDC: HDC; X, Y, nWidth, Height: Integer; SrcDC: HDC;
>  XSrc, YSrc: Integer; Rop: LongInt): Bool;
>Cheers Christian
>--
>-------------------------------------------------------------------------------
>| Christian Braun                                    | TTTTT U   U            |
>| Iwan-N.-Stranski-Institut der TU Berlin            |   T   U   U            |
>| Sekr. ER 1                                         |   T   U   U            |
>| Strasse des 17. Juni 112                           |   T   U   U            |
>| D-10623 Berlin                                     |   T    UUU   Berlin    |
>|                                                    -------------------------|

>|                                                                             |
>|http://webwork.zrz.tu-berlin.de/~insi/ag_findenegg/Christian/christia...  |
>-------------------------------------------------------------------------------

Re:BITS -> BITMAP


I uploaded a CreateDIBsection demo to the Delphi super page a couple of
days ago. It's in the Freeware 2 section. It may help.

John B

Other Threads