muddz / quickshot Goto Github PK
View Code? Open in Web Editor NEW[Moved to MavenCentral] Capture images of any View, SurfaceView or Bitmap from your Android app in: .jpg .png or .nomedia with simple oneliner codes.
License: Apache License 2.0
[Moved to MavenCentral] Capture images of any View, SurfaceView or Bitmap from your Android app in: .jpg .png or .nomedia with simple oneliner codes.
License: Apache License 2.0
I am using Kotlin and trying to capture a webviews contents (including data outside of the screen area) the old java methods I use to use are depraciated (bless google for making things tough)
at first your library seemed like a godsend but I can not get it to work for my needs.
PixelShot.of(generator_webview).save()
captures a blank image
PixelShot.of(generator_webview.view().rootView).save()
captures an image as though the user has used thier phones screenshot function (ie full ui is shown, anything off screen is not etc) impressive how easy that is to do with your library but alas not my goal.
I also could not use the callback code as I can not implement a java class in a kotlin class...thats a lesser issue though
Hello!
I'm trying to make screenshot of layout with rounded CardView inside.
<androidx.cardview.widget.CardView android:innerRadius="0dp" android:shape="ring" app:cardElevation="0dp" app:cardCornerRadius="75dp">
It is rendered correctly on device, but is square on screenshot.Any idea how to fix it?
@OverRide
public void onQuickShotSuccess(String path) {
File file = new File(path);
Uri uri = FileProvider.getUriForFile(this, BuildConfig.APPLICATION_ID +
getString(R.string.file_provider_authority), file);
}
Path not working in android 10 in order to get uri and throws exception :
java.lang.IllegalArgumentException: Failed to find configured root that contains /Pictures/1587840596143.png
here is the logcat. This only happens on emulator. Device works fine.
W/System.err: java.io.FileNotFoundException:myapp/screenshots/1580444203567.png (No such file or directory)
W/System.err: at java.io.FileOutputStream.open0(Native Method)
W/System.err: at java.io.FileOutputStream.open(FileOutputStream.java:287)
W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:223)
W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:171)
W/System.err: at com.muddzdev.quickshot.QuickShot$BitmapSaver.save(QuickShot.java:245)
W/System.err: at com.muddzdev.quickshot.QuickShot$BitmapSaver.doInBackground(QuickShot.java:315)
W/System.err: at com.muddzdev.quickshot.QuickShot$BitmapSaver.doInBackground(QuickShot.java:214)
W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:333)
W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
W/System.err: at java.lang.Thread.run(Thread.java:764)
I have this kind of error when trying to sync project after adding implementation of your lib.
Android resource linking failed
Output:
.../app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
.../app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
.../app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:910: error: resource android:attr/fontVariationSettings not found.
.../app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:910: error: resource android:attr/ttcIndex not found.
error: failed linking references.
May be it's because of conflicts with another libs. I can send you a whole gradle file i you will need it
I tried any view and I had the same problem. do you know why I get this error?
Process: com.hdts.present, PID: 30499 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hdts.present/com.hdts.present.activity.ActivityMain}: java.lang.IllegalArgumentException: width and height must be > 0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3308) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7562) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) Caused by: java.lang.IllegalArgumentException: width and height must be > 0 at android.graphics.Bitmap.createBitmap(Bitmap.java:1113) at android.graphics.Bitmap.createBitmap(Bitmap.java:1080) at android.graphics.Bitmap.createBitmap(Bitmap.java:1030) at android.graphics.Bitmap.createBitmap(Bitmap.java:991) at com.muddzdev.quickshot.QuickShot.getBitmap(QuickShot.java:179) at com.muddzdev.quickshot.QuickShot.save(QuickShot.java:207) at com.hdts.present.activity.ActivityMain.onCreate(ActivityMain.java:85) at android.app.Activity.performCreate(Activity.java:7893) at android.app.Activity.performCreate(Activity.java:7880) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3283)
Hello,
will you make a PCL version for Xamarin Forms?
Thank you.
else if (!Utils.isPermissionGranted(this.getAppContext())) {
throw new SecurityException("Permission WRITE_EXTERNAL_STORAGE is missing");
}
If I want to save to the internal memory of the app, this condition is redundant.
This condition must be removed.
I want to save to the internal memory of the phone and this line does not allow me to do it
File directory = new File(Environment.getExternalStorageDirectory(), path);
Let the user decide where to save
File directory = new File(path);
thanks
I'm trying to capture surface view in camera but it is returning
couldn't create bitmap of the surfaceview
on onQuickShotFailed()
it there any reasons?
View current = preview.getSurfaceView(this);
QuickShot.of(current).setResultListener(this).save();
hello, and sorry for this newbee question.
how can i use this library to take a full screen screenshot, i want to write a simplest screenshot app.
i've viewed the demo code and still don't know how to use the code like:
QuickShot.of(view).setResultListener(this)
.setFilename("Hello World")
.setPath("MyApp/Pictures")
.toPNG()
.save();
sorry for not understanding vary type of fragments..
if bothered closed this please.
private Context getAppContext() {
if (view == null) {
throw new NullPointerException("Attempt to save the view failed: view was null");
}
return view.getContext().getApplicationContext();
}
............
new BitmapSaver(getAppContext(), getBitmap(), saveInternal, path, filename, fileExtension, jpgQuality, listener).execute();
I haven't checked the library's internal code but have seen the demo app & its good!
I need the same type of functionality for my App but it supports 14+.
so any plans for backporting to 14+ or any Info. that can be helpfull for me to backport?
Error ---
method
'io.github.muddz.quickshot.QuickShot
.setResultListener(io.github.muddz.qu ickshot.QuickShot.QuickShot Listener)'
exist 'io.github.muddz.quickshot.QuickShot'
cannot be applied to (com.saveview.MainActivity)'
Question, my page has a lot of data, that doesnt fit your screen.
Is it possible to save the full view, and not only that whats visible in the screen??
Thanks
Can i get the absolute path to the image from the library?
PixelShot is an aw[e]some Android library that can save any View in your app as an image
I am using CameraView Library for rendering camera surface view for video recording, picture capture results in a blank (black) screen.
Could your proved a reason/exception data in OnQuickShotFailed? I'd like to be able to send telemetry and help customers if they having a problem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.