imageview

Android imageView Switching Problem

微笑、不失礼 提交于 2019-12-25 11:54:38
问题 i have imageview and i have to display different image in that with time interval, but when i change the ImageResource the last image is displayed public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView image = (ImageView) findViewById(R.id.test_image); image.setImageResource(R.drawable.test); try { Thread.sleep(2000) ; } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } image =

Android Game development - Imageview automatically shrinks at screen edge

╄→尐↘猪︶ㄣ 提交于 2019-12-25 11:30:44
问题 I have a bunch of dynamically created ImageViews representing different objects in a game, which is working fine. However if any Image reaches the edge of the screen, it shrinks. Looks like android is attempting to create a smooth transition, but this is not wanted. I found another thread with the same issue here: Animation Drawable gets automatically shrinks at the corners ?, however his solution does not work for me, it only enhances the issue as it starts shrinking once the margin hits the

Forced Close after adding custom ImageView

房东的猫 提交于 2019-12-25 09:49:19
问题 I'm trying to add a custom ImageView to my main.xml , but if I start the program it closes with a forced close. XML : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background" > <test.testpkg.CustomImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout

apply rotate transformation in old matrix android

删除回忆录丶 提交于 2019-12-25 09:14:30
问题 I have a matrix for transforming an image. Old matrix is a function of a scale and translation. Now how to apply rotation from center in old Matrix without affecting the other transformation like scale and translation. i already try this //get old matrix Matrix matrix = getImageMatrix(); float tx = getMatrixValue(matrix, Matrix.MTRANS_X); float ty = getMatrixValue(matrix, Matrix.MTRANS_Y); float scaleX = getMatrixValue(matrix, Matrix.MSCALE_X); float scaleY = getMatrixValue(matrix, Matrix

Android : How to Draw multiple images inside the same imageview but shifted in the y coordinate?

不羁的心 提交于 2019-12-25 08:59:30
问题 In my android application I have a horizontal list view and a vertical one. The vertical view contains images. When any of the images is touched, it must go to the horizontal view, but every 3 of them must be drawn over each other in the same image view and shifted upwards so that all the images will appear. Thanks 回答1: use this code for show 2 image in one image: ImageView myImageView = (ImageView) findViewById(R.id.img1); Bitmap bitmap1 = BitmapFactory.decodeResource(getResources(), R

Android ImageView Gesture/DoubleTap not firing

不羁岁月 提交于 2019-12-25 08:48:00
问题 Ok, so I have this setup ScrollView HorizontalScrollView ImageView I am trying to capture the doubleTap on the Image View.. my code looks like the following: ImageView iv = (ImageView)findViewById(R.id.ImageViewID); iv.setImageDrawable(iv.getResources().getDrawable(R.drawable.someimage)); // Gesture detection detector = new GestureDetector(this,new SimpleOnGestureListener(){ //new myGestureClass()); @Override public boolean onSingleTapUp(MotionEvent e) { // TODO Auto-generated method stub

If I have an image 50dp wide/tall in xhdpi, what size do I make for mdpi?

て烟熏妆下的殇ゞ 提交于 2019-12-25 08:17:20
问题 I am working with a graphic designer at the moment who is trying to verify what sizes images I am currently using in my app so he can create new images in the right size for all resolution modes (designing the image at the smallest size and then scaling it for the other modes). In my app, I am emulating a device that is 720 x 1280: xhdpi , and on this device, an ImageView is set to size 50dp x 50 dp . Is it correct to say 50 dp xhdpi -> 25 dp mdpi? 100px? Or 50px? What exactly? What is the

Image load in imageView from gallery become black

笑着哭i 提交于 2019-12-25 08:14:21
问题 So I load image from galley and display into ImageView , the image turn to black. But not all images, just a certain. Why would this happen? @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case RESULT_LOAD_IMAGE: if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK & null != data) { imageUri = data.getData(); imageView.setImageURI(imageUri); } break; } } Then I

GestureDetector detect DoubleClick on GridView items

ぃ、小莉子 提交于 2019-12-25 08:01:54
问题 Note: This specific problem is solved, but there are serious follow-up problems. Have a look at GestureDetector - Detect double click in GridView item's although returning false in onTouchEvent() I want to detect double clicks on distinct items in a GridView of images. Therefore I assigned a separate OnTouchListener to each item- imageView in the getView() method of the adapter. The gestureDetector is a member variable of the adapter-class. private GestureDetectorCompat gestureDetector;

Save original image (.png) even when zoomed

时间秒杀一切 提交于 2019-12-25 07:31:29
问题 I have an apps that let the user to add text/image to the main image, and the main image can be zoomed. My current problem is the produced PNG file is also zoomed if the main image is in zoomed position. My code is saving whatever is displayed to the user, instead of keeping the original image. I currently use getDrawingCache() method. How to let the user zoom in/zoom out my main image but saving the original image instead of the zoomed image? Thanks 来源: https://stackoverflow.com/questions