Texture cutoff

I'm reading an image from the network, sent as a string of chars (b for black, w for white). I'm trying to get this string into a texture I can use. I loop over this string and for every char I put either 0xff or 0x00 into a ByteBuffer of size x*y

That I put into an image, setWidth and setHeight'd to x and y. Image format is Luminance8. This I want to display using normal texture rendering.

I get this result, you can see the original in the bwbwbwbw string console:


Obviously its flipped, but thats not the problem. The problem is that it's also garbage. It looks like its warped, as in I got the byte padding wrong. Anyone know what went wrong? I also tried Intensity16 but that didn't change a thing.

Yes, thats it! Thanks!

Now to give this a color and blur it :confused:

Best guess based on looking at the image you linked to is that the image is trying to end on a word boundary and rounding the width up to 64pixels?

Try padding the end of each row treating it as 64 pixels wide - so after you have written your 44 characters across the image, pad the rest of the row with zeros.