bitmap

Get a vignette effect by shaders

旧巷老猫 提交于 2021-01-29 11:16:15
问题 Im trying to create a vignette effect for my app. I've been searching a lot for help achieving this but was unable to find anything. I recently found this tutorial. And i tried to implement it in my app with this code: public int[] drawBitmap(Bitmap originalBitmap){ Bitmap mask; Paint paint = new Paint(); mask = convertToAlphaMask(BitmapFactory.decodeResource(context.getResources(), R.drawable.spot_mask)); Shader shader = createShader(mask); paint.setShader(shader); Bitmap tempBit = Bitmap

Not able to store image in firebase after cropping and compress image code

时光总嘲笑我的痴心妄想 提交于 2021-01-29 08:37:11
问题 I was able to upload the image in storage earlier but when I added the following code it is not storing now. Help me out. Thanks. public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {super.onActivityResult(requestCode, resultCode, data); if (requestCode == 1 && resultCode == RESULT_OK && data != null) { imageuriOne = data.getData(); CropImage.activity(imageuriOne) .setAspectRatio(1,1) .setMinCropWindowSize(400,400) .start(getContext(),this); if(requestCode ==

how to load image as pixel image in android java?

纵然是瞬间 提交于 2021-01-29 07:04:55
问题 i want to creat an android app that shows all pixels of an image but when i zoom color of the corners of the pixels blend with other pixels around it i want pixels to show their color perfectly in their squares ( like pixel art or ms paint when you zoom it) i tried drawing a rectangle on canvas and drawing a bitmap 1×1 with color what i want but it blends here is a picture and code upper pic 4×4 what it creates lower pic what i want try{ //creating bitmap from other for background bt2 =

Bitmap too large. Tried All

可紊 提交于 2021-01-29 05:34:55
问题 Guys I am facing this issue since 2 days straight. I want to pick an image from gallery and convert it to Base64 method. I have tried Picasso but my imageview is large. Can you please help me. I tried everything but out of memory is too much for me when converting it to bitmap and then to base64. BitmapDrawable drawable = (BitmapDrawable) ProfilePic.getDrawable(); yourSelectedIBitmapDrawable drawable = (BitmapDrawable) ProfilePic.getDrawable(); yourSelectedImage = drawable.getBitmap();mage =

How to test whether pixel is white in byte array?

丶灬走出姿态 提交于 2021-01-29 05:11:56
问题 I'm trying to trim a Bitmap based on white pixels. I'd like to do it efficiently, so I'm avoiding using .GetPixel I'm implementing the marked-correct answer from this question. In the answer, they detect whether pixels in a byte array are transparent. I would like to detect whether the pixels are white instead, with a threshold (so if it is less white than a threshold then foundPixel=true; . I've extracted the relevant code here: static Bitmap TrimBitmap(Bitmap source) { BitmapData data =

How to bluring and debluring bitmap on seekbar change

核能气质少年 提交于 2021-01-29 03:31:26
问题 i am developing image processing and i want to apply blur effect using seekbar. i am using code below to blur bitmap and it works but now i want to deblur bitmap which i can not achieve...plz help me out to this problem private Bitmap blurfast(Bitmap bmp, int radius) { int w = bmp.getWidth(); int h = bmp.getHeight(); int[] pix = new int[w * h]; bmp.getPixels(pix, 0, w, 0, 0, w, h); for(int r = radius; r >= 1; r /= 2) { for(int i = r; i < h - r; i++) { for(int j = r; j < w - r; j++) { int tl =

How to bluring and debluring bitmap on seekbar change

社会主义新天地 提交于 2021-01-29 03:20:27
问题 i am developing image processing and i want to apply blur effect using seekbar. i am using code below to blur bitmap and it works but now i want to deblur bitmap which i can not achieve...plz help me out to this problem private Bitmap blurfast(Bitmap bmp, int radius) { int w = bmp.getWidth(); int h = bmp.getHeight(); int[] pix = new int[w * h]; bmp.getPixels(pix, 0, w, 0, 0, w, h); for(int r = radius; r >= 1; r /= 2) { for(int i = r; i < h - r; i++) { for(int j = r; j < w - r; j++) { int tl =

Bitmap Image as a dictionary key

坚强是说给别人听的谎言 提交于 2021-01-28 20:12:53
问题 I want to know what size should be the image to use it as a hashset/dictionary key. I'm also thinking about using hash functions for this purpose but i'm afraid of hash collisions. I need to store about million of images. 回答1: A bitmap image as a key? That's not a very good idea. Hashset keys should be as small as possible, otherwise performance will suffer significantly. What you can do is calculate a hash value (say a SHA1) from the image, and then use that as the key. It's only 20 bytes so

mfc bitmap reads a completely black bitmap

雨燕双飞 提交于 2021-01-28 18:40:13
问题 I want to use a bitmap to read the current view window, make some changes to it and output the bitmap back to the view. The program is supposed to read a white window and draw a square against this background. However, the image that I see in the final window is a square in a black background. void CScribbleView::OnLButtonDown(UINT, CPoint point) { //CClientDC dc(this); //OnPrepareDC(&dc); HBITMAP initialMap; RECT t; BITMAP bmpScreen; GetClientRect(&t); initialMap = CreateCompatibleBitmap

Wrong image name and type when saving bitmap Android 8

一笑奈何 提交于 2021-01-28 14:41:25
问题 I have a fun that saves bitmap as PNG or JPG (both not working), but seems like using content values not working as expected. File name is incorrect. File type is incorrect. What am I missing ? Works on Android 10, but not working on Android 8 fun Bitmap.save(context: Context) { val contentResolver = context.contentResolver val contentValues = ContentValues().apply { put(MediaStore.MediaColumns.DISPLAY_NAME, "test.png") put(MediaStore.MediaColumns.TITLE, "test") put(MediaStore.MediaColumns