-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image saving in local storage. #20
Comments
Can you show me the full code please? |
I have not done anything extra. It is written (in comment) inside the
example's *void* *renderAndDisplayImage()* function of your package.
https://pub.dev/packages/flutter_painter/example
[image: image.png]
…On Wed, Feb 9, 2022 at 6:56 PM omarhurani ***@***.***> wrote:
Can you show me the full code please?
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHWYARX5JJLSK5YG7SEWI3U2JP6TANCNFSM5N4Q34CQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Regards,
Ibrahim Hossen Rahad
Phone: 01792-530023
Email: ***@***.***
|
Yes, you'll just need to make the function asynchronous and void renderAndSaveImage() async {
if (backgroundImage == null) return;
final backgroundImageSize = Size(
backgroundImage!.width.toDouble(), backgroundImage!.height.toDouble());
// Render the image
// Returns a [ui.Image] object, convert to to byte data and then to Uint8List
final image = await controller.renderImage(backgroundImageSize);
final byteData = await image.pngBytes;
if(byteData == null) return;
// Save image to the temporary directory.
final file = File('${(await getTemporaryDirectory()).path}/img.png');
await file.writeAsBytes(byteData.buffer.asUint8List(byteData.offsetInBytes, byteData.lengthInBytes));
} |
Thanks for the quick response.
But unfortunately, I can not find the saved photo anywhere. I doubt it is
not working.
…On Wed, Feb 9, 2022 at 9:58 PM omarhurani ***@***.***> wrote:
Yes, you'll just need to make the function asynchronous and await the
future.
void renderAndSaveImage() async {
if (backgroundImage == null) return;
final backgroundImageSize = Size(
backgroundImage!.width.toDouble(), backgroundImage!.height.toDouble());
// Render the image
// Returns a [ui.Image] object, convert to to byte data and then to Uint8List
final image = await controller.renderImage(backgroundImageSize);
final byteData = await image.pngBytes;
// Save image to the temporary directory.
final file = File('${(await getTemporaryDirectory()).path}/img.png');
await file.writeAsBytes(byteData.buffer.asUint8List(byteData.offsetInBytes, byteData.lengthInBytes));
}
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHWYASRCJE62SQJHC74DNTU2KFITANCNFSM5N4Q34CQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Regards,
Ibrahim Hossen Rahad
Phone: 01792-530023
Email: ***@***.***
|
Well |
I used ExternalStorageDirectory() and it worked for me. Thanks for your
help. Your package was really helpful.
…On Thu, Feb 10, 2022, 00:11 omarhurani ***@***.***> wrote:
Well getTemporaryDirectory gets the cache directory of the device. Check
out the path provider documentation
<https://pub.dev/documentation/path_provider/latest/path_provider/path_provider-library.html>
to see which directory suits you better.
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHWYAQMGUN3QSS74TSTJDTU2KU6FANCNFSM5N4Q34CQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
vickyleu
pushed a commit
to vickyleu/flutter_painter
that referenced
this issue
Sep 8, 2022
# This is the 1st commit message: modify # This is the commit message omarhurani#2: modify # This is the commit message omarhurani#3: windows toolbar hidden # This is the commit message omarhurani#4: init commit # This is the commit message omarhurani#5: init commit # This is the commit message omarhurani#6: init commit # This is the commit message omarhurani#7: windows toolbar hidden # This is the commit message omarhurani#8: init commit # This is the commit message omarhurani#9: modify # This is the commit message omarhurani#10: modify # This is the commit message omarhurani#11: windows toolbar hidden # This is the commit message omarhurani#12: fullscreen zoom in/out in macos and windows compact # This is the commit message omarhurani#13: fullscreen zoom in/out in macos and windows compact # This is the commit message omarhurani#14: fullscreen zoom in/out in macos and windows compatible, but zoom still crash # This is the commit message omarhurani#15: modify # This is the commit message omarhurani#16: modify # This is the commit message omarhurani#17: windows toolbar hidden # This is the commit message omarhurani#18: modify # This is the commit message omarhurani#19: windows toolbar hidden # This is the commit message omarhurani#20: windows toolbar hidden # This is the commit message omarhurani#21: webrtc screen share # This is the commit message omarhurani#22: crash rep # This is the commit message omarhurani#23: macos screen share # This is the commit message omarhurani#24: screen share with sfu server # This is the commit message omarhurani#25: screen share with sfu server # This is the commit message omarhurani#26: screen share with sfu server # This is the commit message omarhurani#27: screen share with sfu server # This is the commit message omarhurani#28: screen share with sfu server # This is the commit message omarhurani#29: screen share with sfu server # This is the commit message omarhurani#30: nsd host finding by intranet # This is the commit message omarhurani#31: nsd host finding by intranet # This is the commit message omarhurani#32: nsd host finding by intranet # This is the commit message omarhurani#33: commit # This is the commit message omarhurani#34: nsd host finding by intranet # This is the commit message omarhurani#35: nsd host finding by intranet # This is the commit message omarhurani#36: nsd host finding by intranet # This is the commit message omarhurani#37: commit # This is the commit message omarhurani#38: commit # This is the commit message omarhurani#39: nsd host finding by intranet # This is the commit message omarhurani#40: nsd host finding by intranet # This is the commit message omarhurani#41: msvcp140 64 bit dll # This is the commit message omarhurani#42: commit # This is the commit message omarhurani#43: msvcp140 64 bit dll # This is the commit message omarhurani#44: msvcp140 64 bit dll # This is the commit message omarhurani#45: msvcp140 64 bit dll # This is the commit message omarhurani#46: msvcp140 64 bit dll # This is the commit message omarhurani#47: msvcp140 64 bit dll # This is the commit message omarhurani#48: msvcp140 64 bit dll # This is the commit message omarhurani#49: wm touch track # This is the commit message omarhurani#50: commit # This is the commit message omarhurani#51: commit # This is the commit message omarhurani#52: commit # This is the commit message omarhurani#53: wm touch track # This is the commit message omarhurani#54: commit # This is the commit message omarhurani#55: commit # This is the commit message omarhurani#56: commit # This is the commit message omarhurani#57: wm touch track # This is the commit message omarhurani#58: commit # This is the commit message omarhurani#59: commit # This is the commit message omarhurani#60: commit # This is the commit message omarhurani#61: wm touch track # This is the commit message omarhurani#62: wm touch track # This is the commit message omarhurani#63: wm touch track # This is the commit message omarhurani#64: wm touch track # This is the commit message omarhurani#65: wm touch track # This is the commit message omarhurani#66: commit # This is the commit message omarhurani#67: wm touch track # This is the commit message omarhurani#68: wm touch track # This is the commit message omarhurani#69: commit # This is the commit message omarhurani#70: wm touch track # This is the commit message omarhurani#71: wm touch track # This is the commit message omarhurani#72: eraser # This is the commit message omarhurani#73: wm touch track # This is the commit message omarhurani#74: wm touch track # This is the commit message omarhurani#75: commit # This is the commit message omarhurani#76: wm touch track # This is the commit message omarhurani#77: wm touch track # This is the commit message omarhurani#78: wm touch track # This is the commit message omarhurani#79: wm touch track # This is the commit message omarhurani#80: wm touch track # This is the commit message omarhurani#81: wm touch track # This is the commit message omarhurani#82: wm touch track # This is the commit message omarhurani#83: wm touch track # This is the commit message omarhurani#84: wm touch track # This is the commit message omarhurani#85: wm touch track # This is the commit message omarhurani#86: wm touch track # This is the commit message #87: wm touch track # This is the commit message #88: wm touch track # This is the commit message #89: wm touch track # This is the commit message #90: wm touch track # This is the commit message #91: wm touch track # This is the commit message #92: wm touch track # This is the commit message #93: wm touch track # This is the commit message #94: wm touch track # This is the commit message #95: eraser # This is the commit message #96: eraser # This is the commit message #97: eraser # This is the commit message #98: wm touch track # This is the commit message #99: eraser # This is the commit message #100: file manager # This is the commit message #101: file manager # This is the commit message #102: file manager # This is the commit message #103: file manager
vickyleu
pushed a commit
to vickyleu/flutter_painter
that referenced
this issue
Sep 8, 2022
# This is the 1st commit message: modify # This is the commit message omarhurani#2: modify # This is the commit message omarhurani#3: windows toolbar hidden # This is the commit message omarhurani#4: init commit # This is the commit message omarhurani#5: init commit # This is the commit message omarhurani#6: init commit # This is the commit message omarhurani#7: windows toolbar hidden # This is the commit message omarhurani#8: init commit # This is the commit message omarhurani#9: modify # This is the commit message omarhurani#10: modify # This is the commit message omarhurani#11: windows toolbar hidden # This is the commit message omarhurani#12: fullscreen zoom in/out in macos and windows compact # This is the commit message omarhurani#13: fullscreen zoom in/out in macos and windows compact # This is the commit message omarhurani#14: fullscreen zoom in/out in macos and windows compatible, but zoom still crash # This is the commit message omarhurani#15: modify # This is the commit message omarhurani#16: modify # This is the commit message omarhurani#17: windows toolbar hidden # This is the commit message omarhurani#18: modify # This is the commit message omarhurani#19: windows toolbar hidden # This is the commit message omarhurani#20: windows toolbar hidden # This is the commit message omarhurani#21: webrtc screen share # This is the commit message omarhurani#22: crash rep # This is the commit message omarhurani#23: macos screen share # This is the commit message omarhurani#24: screen share with sfu server # This is the commit message omarhurani#25: screen share with sfu server # This is the commit message omarhurani#26: screen share with sfu server # This is the commit message omarhurani#27: screen share with sfu server # This is the commit message omarhurani#28: screen share with sfu server # This is the commit message omarhurani#29: screen share with sfu server # This is the commit message omarhurani#30: nsd host finding by intranet # This is the commit message omarhurani#31: nsd host finding by intranet # This is the commit message omarhurani#32: nsd host finding by intranet # This is the commit message omarhurani#33: commit # This is the commit message omarhurani#34: nsd host finding by intranet # This is the commit message omarhurani#35: nsd host finding by intranet # This is the commit message omarhurani#36: nsd host finding by intranet # This is the commit message omarhurani#37: commit # This is the commit message omarhurani#38: commit # This is the commit message omarhurani#39: nsd host finding by intranet # This is the commit message omarhurani#40: nsd host finding by intranet # This is the commit message omarhurani#41: msvcp140 64 bit dll # This is the commit message omarhurani#42: commit # This is the commit message omarhurani#43: msvcp140 64 bit dll # This is the commit message omarhurani#44: msvcp140 64 bit dll # This is the commit message omarhurani#45: msvcp140 64 bit dll # This is the commit message omarhurani#46: msvcp140 64 bit dll # This is the commit message omarhurani#47: msvcp140 64 bit dll # This is the commit message omarhurani#48: msvcp140 64 bit dll # This is the commit message omarhurani#49: wm touch track # This is the commit message omarhurani#50: commit # This is the commit message omarhurani#51: commit # This is the commit message omarhurani#52: commit # This is the commit message omarhurani#53: wm touch track # This is the commit message omarhurani#54: commit # This is the commit message omarhurani#55: commit # This is the commit message omarhurani#56: commit # This is the commit message omarhurani#57: wm touch track # This is the commit message omarhurani#58: commit # This is the commit message omarhurani#59: commit # This is the commit message omarhurani#60: commit # This is the commit message omarhurani#61: wm touch track # This is the commit message omarhurani#62: wm touch track # This is the commit message omarhurani#63: wm touch track # This is the commit message omarhurani#64: wm touch track # This is the commit message omarhurani#65: wm touch track # This is the commit message omarhurani#66: commit # This is the commit message omarhurani#67: wm touch track # This is the commit message omarhurani#68: wm touch track # This is the commit message omarhurani#69: commit # This is the commit message omarhurani#70: wm touch track # This is the commit message omarhurani#71: wm touch track # This is the commit message omarhurani#72: eraser # This is the commit message omarhurani#73: wm touch track # This is the commit message omarhurani#74: wm touch track # This is the commit message omarhurani#75: commit # This is the commit message omarhurani#76: wm touch track # This is the commit message omarhurani#77: wm touch track # This is the commit message omarhurani#78: wm touch track # This is the commit message omarhurani#79: wm touch track # This is the commit message omarhurani#80: wm touch track # This is the commit message omarhurani#81: wm touch track # This is the commit message omarhurani#82: wm touch track # This is the commit message omarhurani#83: wm touch track # This is the commit message omarhurani#84: wm touch track # This is the commit message omarhurani#85: wm touch track # This is the commit message omarhurani#86: wm touch track # This is the commit message #87: wm touch track # This is the commit message #88: wm touch track # This is the commit message #89: wm touch track # This is the commit message #90: wm touch track # This is the commit message #91: wm touch track # This is the commit message #92: wm touch track # This is the commit message #93: wm touch track # This is the commit message #94: wm touch track # This is the commit message #95: eraser # This is the commit message #96: eraser # This is the commit message #97: eraser # This is the commit message #98: wm touch track # This is the commit message #99: eraser # This is the commit message #100: file manager # This is the commit message #101: file manager # This is the commit message #102: file manager # This is the commit message #103: file manager # This is the commit message #104: wm touch track
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,

I am trying to save the image in local storage using a path. But facing some issues. I was using your code but seems like I am unable to solve these errors.
The text was updated successfully, but these errors were encountered: