leanflutter / screen_capturer

This plugin allows Flutter desktop apps to capture screenshots.
MIT License
79 stars 28 forks source link

How to return imageBytes without saving image to file or copy it to clipboard ? #32

Open dridihaythem opened 3 months ago

dridihaythem commented 3 months ago

i want to know if there is a way to obtain image bytes without saving the images to a file or copying it to the clipboard.?


 Future<String> takeScreenShot() async {
    CapturedData? capturedData = await screenCapturer.capture(
      mode: CaptureMode.window,
      imagePath: null,
      copyToClipboard: false,
    );

    String base64 = base64Encode(capturedData!.imageBytes!);

    return base64;
  }
cn-tre-lfp commented 2 months ago

@dridihaythem in my opinion, there may be performance issues with transferring imageBytes.