bitmap

Converting from RGB ints to Hex

你说的曾经没有我的故事 提交于 2020-08-01 09:31:28
问题 What I have is R:255 G:181 B:178, and I am working in C# (for WP8, to be more specific) I would like to convert this to a hex number to use as a color (to set the pixel color of a WriteableBitmap). What I am doing is the following: int hex = (255 << 24) | ((byte)R << 16) | ((byte)G << 8) | ((Byte)B<<0); But when I do this, I just get blue. Any ideas what I am doing wrong? Also, to undo this, to check the RGB values, I am going: int r = ((byte)(hex >> 16)); // = 0 int g = ((byte)(hex >> 8)); /

CameraX PreviewView Screenshot

强颜欢笑 提交于 2020-07-23 07:07:45
问题 I want to convert CameraX preview to bitmap from previewView. Something similar to textureView.bitmap I have tried it with a textureview and it works perferctly, i can take a screenshot of the cameraview but the camera is stretched. 回答1: PreviewView now supports screenshot by calling PreviewView.getBitmap(). See: https://developer.android.com/reference/androidx/camera/view/PreviewView#getBitmap() 回答2: I finally found the answer in this link First set preferred implementationmode to

CameraX PreviewView Screenshot

半城伤御伤魂 提交于 2020-07-23 07:07:20
问题 I want to convert CameraX preview to bitmap from previewView. Something similar to textureView.bitmap I have tried it with a textureview and it works perferctly, i can take a screenshot of the cameraview but the camera is stretched. 回答1: PreviewView now supports screenshot by calling PreviewView.getBitmap(). See: https://developer.android.com/reference/androidx/camera/view/PreviewView#getBitmap() 回答2: I finally found the answer in this link First set preferred implementationmode to

CameraX PreviewView Screenshot

假装没事ソ 提交于 2020-07-23 07:06:03
问题 I want to convert CameraX preview to bitmap from previewView. Something similar to textureView.bitmap I have tried it with a textureview and it works perferctly, i can take a screenshot of the cameraview but the camera is stretched. 回答1: PreviewView now supports screenshot by calling PreviewView.getBitmap(). See: https://developer.android.com/reference/androidx/camera/view/PreviewView#getBitmap() 回答2: I finally found the answer in this link First set preferred implementationmode to

CameraX PreviewView Screenshot

你说的曾经没有我的故事 提交于 2020-07-23 07:05:21
问题 I want to convert CameraX preview to bitmap from previewView. Something similar to textureView.bitmap I have tried it with a textureview and it works perferctly, i can take a screenshot of the cameraview but the camera is stretched. 回答1: PreviewView now supports screenshot by calling PreviewView.getBitmap(). See: https://developer.android.com/reference/androidx/camera/view/PreviewView#getBitmap() 回答2: I finally found the answer in this link First set preferred implementationmode to

transfer bitmap between two activities in Kotlin

三世轮回 提交于 2020-07-23 06:56:10
问题 There are some answers using java in stackoverflow but i am unable to convert it into kotlin code. I am new to kotlin. Please tell me how to transfer bitmap data from one activity to another using Intent 回答1: You need to pass the bitmap as an extra argument to the intent while starting the activity. val intent = new Intent(this, NewActivity::class.java) intent.putExtra("BitmapImage", bitmap) startActivity(intent); and retrieve it as: val bitmap = this.intent?.getParcelableExtra("BitmapImage")

transfer bitmap between two activities in Kotlin

耗尽温柔 提交于 2020-07-23 06:55:31
问题 There are some answers using java in stackoverflow but i am unable to convert it into kotlin code. I am new to kotlin. Please tell me how to transfer bitmap data from one activity to another using Intent 回答1: You need to pass the bitmap as an extra argument to the intent while starting the activity. val intent = new Intent(this, NewActivity::class.java) intent.putExtra("BitmapImage", bitmap) startActivity(intent); and retrieve it as: val bitmap = this.intent?.getParcelableExtra("BitmapImage")

transfer bitmap between two activities in Kotlin

五迷三道 提交于 2020-07-23 06:54:06
问题 There are some answers using java in stackoverflow but i am unable to convert it into kotlin code. I am new to kotlin. Please tell me how to transfer bitmap data from one activity to another using Intent 回答1: You need to pass the bitmap as an extra argument to the intent while starting the activity. val intent = new Intent(this, NewActivity::class.java) intent.putExtra("BitmapImage", bitmap) startActivity(intent); and retrieve it as: val bitmap = this.intent?.getParcelableExtra("BitmapImage")

how to display multiple byte array to gridview

核能气质少年 提交于 2020-07-22 05:44:28
问题 I am working with a ByteArray which contains multiple images.basically when I capture image from camera that byte array converted into string array and store that string to SQLite . like below. and then get this string and converted to byte then trying to display images into grid view but instead of getting capture image I am getting only imageview. here is my code : SharedPreferences settings = getSharedPreferences("image String", Context.MODE_PRIVATE); String encodedImage = settings

Calculating the shortest path between two points in a bitmap in python

ぃ、小莉子 提交于 2020-07-17 06:41:26
问题 I have a black and white bitmap image shown here: The image size is 200,158. I want to pick two points that fall on the white path and calculate the shortest distance between those two points following only the white pixels. I am not sure how to approach this problem. I want to create a function that I call with 2 sets of x,y coordinates and it returns the number of pixels following the shortest route along the white pixels only. Any pointers would be greatly appreciated. 回答1: As stated in