-
Notifications
You must be signed in to change notification settings - Fork 136
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
Is There An Exposed Method To Programmatically Create The Filtered Image #47
Comments
Hi @RalphMarvin You can use the following code to apply the filter on a file
if you want to save the filtered image to file (say at path I will try to expose a function in the package in the upcoming release :) |
Okay, thank you very much for the code samples, exactly what I need.
…On Sat, Sep 5, 2020, 2:28 PM Sharafudheen KK ***@***.***> wrote:
Hi @RalphMarvin <https://github.com/RalphMarvin>
You can use the following code to apply the filter on a file
Image applyFilterOnImageFile(Filter filter, File src) {
Image image = decodeImage(src.readAsBytesSync());
var pixels = image.getBytes();
filter.apply(pixels, image.width, image.height);
Image out = Image.fromBytes(image.width, image.height, pixels);
return out;
}
if you want to save the filtered image to file (say at path destFileName),
use return new File(destFileName).writeAsBytesSync(encodeNamedImage(out,
destFileName));
I will try to expose a function in the package in the upcoming release :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADY6HKGUMCN5GKS4CMZMO5TSEJDITANCNFSM4QUVYCCA>
.
|
But with this approach, how can you get the selected filter ? |
You are passing the selected filter to this method. |
What am trying to achieve is handle several images, I have managed to get all the images in page carousel, so when you swipe left and right you see all the images along side the filters. My problem right now, all this navigation is done inside a page (stateful widget). I cant seem to find a way of getting all the filtered images so i was wondering if there is an exposed method that can be called to return the filtered image.
The text was updated successfully, but these errors were encountered: