android-bitmap

When saving bitmap to disk, solid paths show artifacts

♀尐吖头ヾ 提交于 2019-12-03 16:33:38
[Edit: I've made a minimal project to try to narrow down what's going on. The code at the bottom still generates the same artifacts when saved] I have an app that draws simple 2D geometry using Paths. The shapes are all solid colors, sometimes with alpha < 255, and may be decorated with lines. In the View that draws the geometry, there has never been an issue with how things get drawn. However, when I use the same code to draw to a Bitmap, and then save it as either a JPEG (with 100 quality) or PNG, there is always the same artifacting in the solid-colored areas of the output files. It's a

Pinch zooming on an image in Xamarin

≯℡__Kan透↙ 提交于 2019-12-03 15:57:33
In Xamarin , what is the best way to enable pinch zooming for an image? Currently I have just an ImageView that has a Bitmap image as an image. I have done some research, and I have found a few examples where people have used some other libraries but would like some advice on the best way to enable pinch zooming on an image before I start writing this code. So, what is the best way to enable pinch zooming on an image in Android , specifically Xamarin ? Thank in advance You can get ImageView zoom-in capabilities and panning of the zoomed in image by using the Monodroidtoolkit ScaleImageView.

Convert Android Bitmap to OpenCV Mat and backwards

心不动则不痛 提交于 2019-12-03 13:15:48
问题 I wanted to simply convert a bitmap from Android to a Mat object for OpenCV. This topic is often adressed on Stack Overflow. For example: convert Mat to Bitmap Opencv for Android ; convert Bitmap to Mat after capture image using android camera ; templateMatching mattoBitmap opencv for android There is even more to find. I followed the instrcutions in this answers, but I'm still unable to get is done the right way. Minimal code: //First convert Bitmap to Mat Mat ImageMat = new Mat ( image

Android Blur View (Blur background behind the view)

一世执手 提交于 2019-12-03 07:38:12
问题 I am trying to make the bottom part of an Image blur for the view on top it like in the image. I tried blurring it using Rendenscript but I am not able to blur only the part behind the view. :( I have seen many libraries but almost all of them blur the entire image, but not a part of it. Also, an important part is that I am using this inside a ViewPager and hence needs to be fast and dynamic something like this in IOS which redraws itself the moment image behind it changes. Any help is

Convert Android Bitmap to OpenCV Mat and backwards

点点圈 提交于 2019-12-03 02:40:58
I wanted to simply convert a bitmap from Android to a Mat object for OpenCV. This topic is often adressed on Stack Overflow. For example: convert Mat to Bitmap Opencv for Android ; convert Bitmap to Mat after capture image using android camera ; templateMatching mattoBitmap opencv for android There is even more to find. I followed the instrcutions in this answers, but I'm still unable to get is done the right way. Minimal code: //First convert Bitmap to Mat Mat ImageMat = new Mat ( image.getHeight(), image.getWidth(), CvType.CV_8U, new Scalar(4)); Bitmap myBitmap32 = image.copy(Bitmap.Config

Custom Brush with Undo/Redo operation in Android Canvas

笑着哭i 提交于 2019-12-02 23:17:16
问题 I want to implement a canvas drawing application with custom brush & undo/redo operation. First of all my code works perfectly without using the custom brush (including the undo/redo operation). According to this answer How to make custom brush for canvas in android? I used simple image spikes for bitmap draw. Now the issue are, The undo, redo operation doesn't works, custom brush paints over and over again whenever moving the touch points. Q: How to make the undo/redo operation work? The

Copy Image from FilePicker/Intent to another Directory

让人想犯罪 __ 提交于 2019-12-02 18:15:48
问题 I am trying to copy Image i receive from Intent to another directory. But I am unable to get it working yet. Need Help. My Logcat: 04-29 14:56:22.778 31620-31620/com.example.krupal.sqlitetest I/Choreographer: Skipped 42 frames! The application may be doing too much work on its main thread. 04-29 14:56:24.944 31620-31633/com.example.krupal.sqlitetest W/EGL_emulation: eglSurfaceAttrib not implemented 04-29 14:56:24.944 31620-31633/com.example.krupal.sqlitetest W/OpenGLRenderer: Failed to set

Getting Bitmap from TextLayout in onCreate

懵懂的女人 提交于 2019-12-02 09:37:20
I am able to convert a Layout with a TextView into a Bitmap , as long as the event that happens after onCreate() . But when I try during on create, it does not work. Is there a way to get this to work? I have tried using inflate() in various ways with no joy. There are various answered questions including this one that address the technique that I'm successfully using in my code. But the success does not include employing the technique from onCreate() . public class MainActivity extends AppCompatActivity { private static final String TAG = MainActivity.class.getSimpleName(); private

Copy Image from FilePicker/Intent to another Directory

痞子三分冷 提交于 2019-12-02 09:01:30
I am trying to copy Image i receive from Intent to another directory. But I am unable to get it working yet. Need Help. My Logcat: 04-29 14:56:22.778 31620-31620/com.example.krupal.sqlitetest I/Choreographer: Skipped 42 frames! The application may be doing too much work on its main thread. 04-29 14:56:24.944 31620-31633/com.example.krupal.sqlitetest W/EGL_emulation: eglSurfaceAttrib not implemented 04-29 14:56:24.944 31620-31633/com.example.krupal.sqlitetest W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7f5170636740, error=EGL_SUCCESS 04-29 14:56:26.370 31620-31633/com.example

setCloseButtonIcon(Bitmap drawable) is not working with SVGs in ChromeCustomTab

做~自己de王妃 提交于 2019-12-02 08:03:46
I need to change the default cross-icon in ChromeCustomTab Android, I am changing it with back-icon using the code below: Bitmap icon = BitmapFactory.decodeResource(context.getResources(),R.drawable.ic_arrow_back_white_24dp); It is working fine with PNGs but not with SVGs. As per this documentation, we have to maintain size of image according to this documentation. https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent.html#KEY_ICON I think it is not working because they are not following the dimensions given in Documentation. You need to return a valid Bitmap .