Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Draw raw pixels received from socket on a TBitmap


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Oct 23, 2017 9:17 AM Last Post By: Remy Lebeau (Te...
Mrad Chems

Posts: 1
Registered: 9/20/13
Draw raw pixels received from socket on a TBitmap  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 22, 2017 8:09 PM
Hi all,

So basically, my program receives raw grayscale pixels (single channel, 8-bit, unsigned char) from a network packet and I want to draw this on a TImage. The decoded input is recorded on an instance of the following structure;
struct gray_bitmap
{
      unsigned char *zBlob; /* The raw grayscale pixels */
      int width; /* Bitmap width */
      int height; /* Bitmap height */
};

My question is how to draw the raw pixels on a TBitmap or TCanavs members of the TImage Firemonkey component? Should I use Streams?. Any help is highly appreciated.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Draw raw pixels received from socket on a TBitmap  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2017 9:17 AM   in response to: Mrad Chems in response to: Mrad Chems
Mrad Chems wrote:

My question is how to draw the raw pixels on a TBitmap or TCanavs
members of the TImage Firemonkey component? Should I use Streams?.

Look at the TBitmap::Map() method.

http://docwiki.embarcadero.com/Libraries/en/FMX.Graphics.TBitmap.Map

It gives you direct access to a bitmap's pixel data, which you can then
fill in as needed.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02