android-graphics

How to understand the underneath of setDisplay/setSurface/setPrewviewDisplay/setPreviewTexture for Android

感情迁移 提交于 2019-12-11 13:26:00
问题 Since Android api level 1, We can attach a MediaPlayer or Camera to the Surface with setDisplay or setPrewviewDisplay, then image data can be transfered to gpu and processed much faster. After SurfaceTexture is introduced, We can create our own texture with the target GL_TEXTURE_EXTERNAL_OES and attach the MediaPlayer or Camera to opengl es. These are well known, but what I want to talk about is the underneath which is about Android graphics architecture.(Android Graphics architecture) The

How to detect the Corners / Center X, Y Coordinates Using Google's Face API?

大兔子大兔子 提交于 2019-12-11 05:08:34
问题 Good day all, I am using Google's new Face API (Link here) which works with improved FaceDetection. One of the things you get back is a List of Landmark objects, each of which has an X and Y coordinate to use. With these coordinates, I am trying to figure out the center of the picture, but figuring out the correct numbers is proving difficult. Here is what I know so far: 1) Unlike in the old ways, it is no longer 1000, 1000 by -1000, -1000 2) The coordinates that are returned are in float

How to get bitmap of a view? [duplicate]

雨燕双飞 提交于 2019-12-10 19:16:51
问题 This question already has answers here : Convert view to bitmap on Android (5 answers) Closed 2 years ago . Ok, so I'll try my best to explain my problem. I have used this code to get a "screenshot" of my FrameLayout /** * Function that takes a screenshot of the view passed and returns a bitmap for it. * * @param view {@link View} * @return screenshot of the view passed */ public Bitmap screenShot(View view) { Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap

Flood fill algorithm on vector drawable image view

我的梦境 提交于 2019-12-08 06:05:29
问题 I want to create application like this. Flood fill algorithm I applied that code and it is working fine with JPG or PNG file. But I want to use that algorithm with Vector drawable imageview Vector drawable imageview before flood fill After flood fill of vector imageview Expected result should be like this (Flood fill work perfectly when I set JPG or PNG file) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity