bitmap

Android webview screenshot white border

女生的网名这么多〃 提交于 2020-01-05 19:31:25
问题 i followed this link to screenshot my webview completely. It works fine. But I have an issue. The screenhot that I get from the webview contains white spaces on the top and bottom of the picture? How do I get rid of this? Kindly let me know. This is the code that I've used for capturing from webview. IF YOU LOOK PROPERLY THERE IS WHITESPACE BOTH AT THE BOTTOM AND TOP PARTS OF THE IMAGE. public static String saveCapturedImageToSdCard() { Picture picture = WebViewActivity.sWebViewEx

Android webview screenshot white border

穿精又带淫゛_ 提交于 2020-01-05 19:30:29
问题 i followed this link to screenshot my webview completely. It works fine. But I have an issue. The screenhot that I get from the webview contains white spaces on the top and bottom of the picture? How do I get rid of this? Kindly let me know. This is the code that I've used for capturing from webview. IF YOU LOOK PROPERLY THERE IS WHITESPACE BOTH AT THE BOTTOM AND TOP PARTS OF THE IMAGE. public static String saveCapturedImageToSdCard() { Picture picture = WebViewActivity.sWebViewEx

Separation of background/foreground layers in a scanned document

南楼画角 提交于 2020-01-05 09:32:35
问题 I need to automatically remove the mildly colored background of a scanned document image for OCR. ScanTailor is an open source C++ GUI-based app that does background separation among other things, but I cannot figure out how to run only the last step which actually removes the background. Ideally, I could find the code that does this and either: Port that part to C# Modify the C++ to respond to command line execution, only performing that step on a given image Can you help me understand how I

Separation of background/foreground layers in a scanned document

我们两清 提交于 2020-01-05 09:31:29
问题 I need to automatically remove the mildly colored background of a scanned document image for OCR. ScanTailor is an open source C++ GUI-based app that does background separation among other things, but I cannot figure out how to run only the last step which actually removes the background. Ideally, I could find the code that does this and either: Port that part to C# Modify the C++ to respond to command line execution, only performing that step on a given image Can you help me understand how I

how to maintain canvas size when converting python turtle canvas to bitmap

寵の児 提交于 2020-01-05 07:08:10
问题 I want to convert a Python Turtle module (tkinter) canvas into a bitmap. I have followed the suggestion at "How to convert a Python tkinter canvas postscript file to an image file readable by the PIL?" to convert it first to postscript; then I open it as a PIL image, then save that as a bitmap. But the bitmap is a different size from the original canvas. import turtle import io from PIL import Image myttl = turtle.Turtle() wd=500 ht=500 turtle.setup(width=wd, height=ht, startx=0, starty=0)

java OutOfMemoryError: bitmap size exceeds VM budget

余生颓废 提交于 2020-01-05 07:02:13
问题 I have ImageView & one button on my ImageActivity. when the button is clicked the available images are listed, when one of them is clicked, it is loaded into the ImageView. imageView xml: <ImageView android:id="@+id/imageView" android:layout_width="300dip" android:layout_height="300dip" android:src="@android:drawable/alert_light_frame" /> Please see the code: public class ImageActivity extends Activity { private static final int SELECT_PICTURE = 1; private String selectedImagePath; private

Is there any way to get the storage size of a Bitmap?

青春壹個敷衍的年華 提交于 2020-01-05 06:38:31
问题 In my app I am downloading some images and I want to know if there is any way I can get the size of a Bitmap that I have downloaded. It's a simple question but i can't seem to find the solution through Google. here's the code for downloading: Bitmap b = BitmapFactory.decodeStream((InputStream) new URL(theImageUrl).getContent()); 回答1: First convert the Bitmap into byte[] then you can get the size of bitmap Try with thye following code Bitmap bitmap = your bitmap object ByteArrayOutputStream

Solve black screen while converting textview into bitmap

你。 提交于 2020-01-05 05:56:34
问题 I want to convert textView into Bitmap but I am getting blackscreen Instead of the data inside textview. Screen I want to convert Screen which I am getting after drawing cache I don't know where I am going wrong. Following is my code abc.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android

Bitmap drawable (Map Overlay Item) pixelizes after rotation in android

天大地大妈咪最大 提交于 2020-01-05 05:40:10
问题 I'm trying to rotate an overlay drawable to represent an overlay item in Android. I use this: Bitmap bmpOriginal = BitmapFactory.decodeResource(this.getResources(), R.drawable.map_pin); Bitmap targetBitmap = Bitmap.createBitmap((bmpOriginal.getWidth()), (bmpOriginal.getHeight()), Bitmap.Config.ARGB_8888); Matrix matrix = new Matrix(); matrix.setRotate((float) lock.getDirection(),(float) (bmpOriginal.getWidth()/2), (float)(bmpOriginal.getHeight()/2)); Canvas tempCanvas = new Canvas

Why ByteArrayOutputStream sometimes gives me null pointer exception?

本秂侑毒 提交于 2020-01-05 05:11:26
问题 When loading a picture into byte[] in smartphone app sometimes ByteArrayOutputStream gives me nullpointerexception any explanation? Bitmap bm = BitmapFactory.decodeFile(path); System.out.println("BITMAP: "+bm != null); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); bm.compress(CompressFormat.JPEG, 100, buffer); 回答1: Are you sure it's ByteArrayOutputStream that's giving you the NullPointerException? Or is it happening at bm.compress? bm can be null - likely due to you passing in