Now I got a python bytes like this: b'\x00\x00\x00\x00\x07\x80\x00\x03'
, and it's from an image, how can I handle it in C# , and convert to a byte[ ]
and then return it as a Bitmap
?
Here is my Python code:
fig = plt.figure()
canvas = fig.canvas buffer = io.BytesIO()
canvas.print_png(buffer)
bin_data = buffer.getValue()
buffer.close()
#Excuting reults like this:
bin_data : b'\x00\x00\x00\x00\x07\x80\x00\x03' # just a sample
list(bin_data) :[0, 0, 0, 0, 7, 128, 0, 3] # sample
Is there any way to handle it in C#(client) and transform bin_data/list(bin_data)
to a C# byte[]
or an image Stream ?