DPI added to encode ByteArray method