diff --git a/lime/graphics/format/PNG.hx b/lime/graphics/format/PNG.hx index 8a4758c1c..e7bb963a1 100644 --- a/lime/graphics/format/PNG.hx +++ b/lime/graphics/format/PNG.hx @@ -101,12 +101,7 @@ class PNG { try { var bytes = Bytes.alloc (image.width * image.height * 4 + image.height); - - #if flash - var sourceBytes = Bytes.ofData (image.buffer.data.getByteBuffer ()); - #else - var sourceBytes = cast image.buffer.data; - #end + var sourceBytes = image.buffer.data.toBytes (); var sourceIndex:Int, index:Int;