android-bitmap

android Scrollable wallpaper on screen's phone programmatically

拟墨画扇 提交于 2019-12-11 23:35:31
问题 I am developing a wallpaper application in Android and i am finding a right way to set scrollable wallpaper for my app. Now, my code can set wallpaper from bitmap but it was cropped to fit with one page and just stayed only on one page (i have 5 pages in home screen). That means the content in each page can scroll through the wallpaper but the wallpaper was not scroll. I want to set a scrollable wallpaper. I tried some codes from internet but they did not help. Do you guys have any idea?

starting activity with a non-activity class

≡放荡痞女 提交于 2019-12-11 20:29:29
问题 I have an onClick method of a checkbox in a class that extends baseAdapter here: @Override public void onClick(View v) { if (addCheckbox.isChecked()) { System.out.println("Checked"); PackageManager pm = mContext.getPackageManager(); final int DEST_IMAGE_WIDTH = 100; final int DEST_IMAGE_HEIGHT = 100; ApplicationInfo appInfo = mContext.getApplicationInfo(); Drawable appIcon = pm.getApplicationIcon(appInfo); Bitmap appBmp = Bitmap.createBitmap(DEST_IMAGE_WIDTH, DEST_IMAGE_HEIGHT, Config.ARGB

Bitmap changes size. Gets almost 20 times larger

偶尔善良 提交于 2019-12-11 19:55:53
问题 In my android app the user takes and saves a picture it is then converted to a bas64 string where it is about 55000 characters long. Then later in the program I retrieve the image and again convert it to a base64 string except now its over 2 million characters. Can any one explain why this happens? code for re-retrieving the image. Bitmap imgBitmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), Uri.parse(imgFilePath)); 来源: https://stackoverflow.com/questions/21023693

How to get the bitmap of complete scrolled area of view implemented with GestureListener with Scroller

余生长醉 提交于 2019-12-11 18:07:34
问题 What I have Tried: I'm drawing shapeDrawables in onDraw(Canvas canvas) in a custom view with using GestureListener in view for Scroller (not scrollview). code is available on Gist I'm trying to take the Bitmap image of that view which contains GestureListener with Scroller implementation public void save(String fname, View view) throws FileNotFoundException { try { String filename = Environment.getExternalStorageDirectory() .toString(); File f = new File(filename, "myImage.png"); f

How to convert YUV to bitmap in landscape orientation?

徘徊边缘 提交于 2019-12-11 16:07:35
问题 First Method When I set javasetRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); or java setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); Camera2 is running fine and save image from imageavailablelistener. Second Method When I set java setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); or java setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); It will exit from the app and cannot save image Conversion Credit YUV Image to

Cannot Find Image Stored

自古美人都是妖i 提交于 2019-12-11 15:16:38
问题 I am currently using this code to store images (it might be wrong). The path is this: public static final String IMAGE_DIR = "test"; The code for saving the image is as follow: public class ImageSaver { private String directoryName = Constants.IMAGE_DIR; private String fileName = ""; private Context context; private boolean external; public ImageSaver(Context context) { this.context = context; } public ImageSaver setFileName(String fileName) { this.fileName = fileName; return this; } public

Setting BitmapDrawable tileMode makes the app restart

此生再无相见时 提交于 2019-12-11 13:04:19
问题 While on most of the devices my app is working fine, on some devices (LG G3, Samsung Galaxy S6 so far) I have experienced a strange error, I can not really unfold: Setting tileMode (either via XML or programmatically) to anything ( clamp / repeat / mirror ) on a BitmapDrawable , that is the backround of a layout, makes that background completely black-, and the app restart after ~20 seconds - without any sign of anything going wrong (no messages in LogCat, none of these callbacks of my

Draw images on evey touch co-ordinats Of Imageview

无人久伴 提交于 2019-12-11 11:53:19
问题 I want to draw small circular images at every point where user touches existing Image-view in android.And want to handle the click of every small ploted image.Right now I am trying to draw circluar image on ImageView but its not working for me. Here is my code : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FFFFFF" android:orientation=

Texture View video and Bitmap display

放肆的年华 提交于 2019-12-11 11:42:32
问题 I have a TextureView that displays a bitmap(placeholder image) and when the user loads a video the textureView should show the video. I managed to get video playback in the texture view and showing a bitmap in a textureview, but when done in sequence i just get a black screen. In my onSurfaceTextureAvailable method i draw a bitmap on the surface view as followed: @Override public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { Bitmap bm = BitmapFactory

How do I select a region by color in a Bitmap?

五迷三道 提交于 2019-12-11 10:22:43
问题 Please suggest an efficient way to select a region by color in a bitmap. Then replace this selected region-color to your desired color. For example, If an image contains four colors say red, green, yellow, orange. Now suppose user clicked on yellow color, so select yellow colored region surrounding to the clicked position and now replace the yellow color to blue. Hope, I explained the question properly. Kindly comment if need any more clarification. As per my knowledge, bitmap is a memory