I'm asking about how can I Rotate (Y-axis) a picture in ImageView programmatically in kotlin or java for android Studio as showed below
I searched a lot.. Googled it.. but no answers
Here an example:
Another Example:
To rotate your image on the Y-Axis, All you have to do is set this on your imageView. Keep in mind this is for Java.
imageView.setRotationY(25);
Your image will rotate just like you wanted, you can change the float value if you want.
Related
I have a activity in my android app which is receiving a bitmap from previous activity through intent. In the image view of the current activity I want to display that bitmap along with the contour on largest rectangle or square found in the bitmap and the contour should be adjustable so that I can adjust it in case its not correct and then when I click ok it should perform a 4 point perspective transformation on the bitmap and display it in the same image view. I searched through web a lot but I could not find what I was looking for.
This is the result I want:
How can I achieve this in opencv java android studio. I am new to opencv so I don't have even a slightest idea about how can I do that and where should I start.
Thank you.
I am trying to learn how to use ndk and renderscript. This is what i tried so far. I am using renderscript to convert nv21 frame to rgb. After that, i am getting the pixels from the rgb and sending the pixels to the ndk script to convert to grayscale. Then i created a bitmap from the grayscale pixels and i am rendering the bitmap to the imageview. Things seem to be working fine. However, I am facing an issue. When the preview is rendered in the imageview, the bitmap appears to be rotated. What could i be doing wrong ?
The NV21 frame received from the camera on most phones is always in landscape (see CameraInfo.orientation.
I tried rotating the imageview but then the grayscale effect disappears
Please show your code, there is some easy typo probably
I was asked to work on this shape called the Squircle. It is very similar to a rounded rectangle or square with rounded corners. However that's not the desired shape. How can I achieve this?
I came up with my own solution, and today is a very simple library, here's the link.
https://github.com/MicroRJ/android_superellipse
Here are a few sample images of my particular output.
You can create Shape Drawable and set corner radius.
I make a game with cocos2d ported on android and i'm try to stretch CCSprite to fit screen. I founded the answer Images handling in cocos2d android? but this way suggests a big blow on size the app. Do you have another suggestion?
Have you tried changing the scale of the sprite? You could calculate the factor between sprite and screen dimensions, and apply it to the sprite scale.
I need to have an Android app with ImageView on the screen and user should be able to draw a custom (closed) shape (something like a circle/ellipse) made of curves to select an object on the image. The shape then has to be saved to String (like M123,21L23,30C100,29...). Does anybody know how to achieve this ? Or just point me the right direction. Thanks
If you just want to draw another bitmap on your ImageView and it shouldn't be dynamic, than use AbsoluteLayout and position them above each other.
If it should be much more dynamic, I recommend to use a SurfaceView. A tutorial can be found here: Custome Shape from Photo