TPixmap.pixels.size ??

BlitzMax Forums/BlitzMax Programming/TPixmap.pixels.size ??

plash(Posted 2008) [#1]
I need to send a pixmap over TCP to a client app. I should be able to use WriteBytes() to send the bytes to the client, I can pass in pixmap.pixels for the data, but how do I find the size of them? (or what would go in the 'count' parameter?)

Any other suggestions on sending a pixmap through TCP?

EDIT: Unsure of this, but perhaps width * height * 8? since a byte is 8 bits..

EDIT2: pixmap.capacity?


plash(Posted 2008) [#2]
pixmap.capacity seemed to work.

But will capacity change over time? like when the pixmap data is changed?


Bremer(Posted 2008) [#3]
If it is a RGBA pixmap (32 bit) with alpha, then its 4 bytes per pixel. So that would be width*height*4 = total bytes.


tonyg(Posted 2008) [#4]
Capacity is used to create the memory holding the pixmap pixels so is probably good to use.