Recent

Author Topic: Bitmap 8bit  (Read 4413 times)

addebito

  • New member
  • *
  • Posts: 8
Bitmap 8bit
« on: October 07, 2008, 04:50:07 pm »
Hi to all.
I don't understand how paint into a TImage component a simple bitmap (8 bit for pixel).  :(
For example:
buf : array [100..100] of byte;
This is a buffer of bytes that represent my image and 1 byte is equal of 1 pixel (black: 0, white: 255).
Please can you post a example for write this image buffer on a Timage component ?!?

...because the Image1.Picture.Bitmap.Canvas.Pixel <--- this accept a TColor.
I must pass only a byte not a TColor.

Thak you in advance.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927
RE: Bitmap 8bit
« Reply #1 on: October 07, 2008, 06:51:23 pm »
If it's black&white only, why don't you simply pass clBlack or clWhite?

addebito

  • New member
  • *
  • Posts: 8
Re: RE: Bitmap 8bit
« Reply #2 on: October 07, 2008, 07:14:50 pm »
Quote from: "theo"
If it's black&white only, why don't you simply pass clBlack or clWhite?

No, isn't only black & white.
In all byte of my array I can have the value from 0 to 255.
Practically my buffer is an image that I capture width a camera device, but it isn't a color camera.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927
RE: Re: RE: Bitmap 8bit
« Reply #3 on: October 07, 2008, 07:34:58 pm »
So it's grayscale?
Then you pass RGBToColor(byteval,byteval,byteval);

 

TinyPortal © 2005-2018