SkDynamicMemoryWStream stream; const char* myString = "Hello, world!"; size_t len = strlen(myString); stream.write(myString, len);
SkDynamicMemoryWStream stream; SkBitmap bitmap; // assume this is a valid bitmap object sk_spIn this example, we create a new SkDynamicMemoryWStream object called "stream", then create a new SkBitmap object called "bitmap". We then encode the bitmap as a JPEG image with 80% compression and get a pointer to the encoded data buffer by calling the encodeToData method on bitmap. Finally, we write the data from the buffer to the SkDynamicMemoryWStream object. Package Library: Skia Graphics Library.data = bitmap.encodeToData(SkEncodedImageFormat::kJPEG, 80); stream.write(data->data(), data->size());