imageview

android drag and drop ImageView onTouchListener

泪湿孤枕 提交于 2019-11-27 03:38:30
问题 Hello I've set up an onTouchListener within my application for an ImageView, my aim was to have an ImageView that the user would be able to drag around and place where ever they want within the app. I've written some code using sample code found on the web for an onTouchListener that I thought would work but I'm having some problems with it, rather than allowing me to drag the image around, the image resizes and gets bigger or smaller when you drag your finger over it. Does anyone have any

Put a big image in an ImageView not working

此生再无相见时 提交于 2019-11-27 03:34:52
问题 I think there is a problem with my ImageView. i created a gallery, where I can touch an image and put it in my ImageView below: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/fonddegrade"> <Gallery android:layout_height="wrap_content" android:id="@+id/gallery" android:layout_width="fill_parent" /> <ImageView android:layout_below="@+id/gallery" android:layout_height=

How can I show an image using the ImageView component in javafx and fxml?

回眸只為那壹抹淺笑 提交于 2019-11-27 03:29:07
问题 I suppose it's a very simple thing but I just can't get behind it. All I want is to show an image over an ImageView linked to fxml. Here is my code: package application; import java.io.File; import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.AnchorPane; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; public class Main extends Application { @FXML

Android Changing image size depending on Screen Size?

我的梦境 提交于 2019-11-27 03:28:44
问题 So I need to change the size of an image depending on the area of the screen. The image will have to be half of the screen height, because otherwise it overlaps some text. So Height= 1/2 Screen Height. Width = Height*Aspect Ratio (Just trying to keep the aspect ratio the same) I found something that was: Display myDisplay = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); int width =myDisplay.getWidth(); int height=myDisplay.getHeight(); But how would I change

Having issue on Real Device using vector image in android. SVG-android

我的梦境 提交于 2019-11-27 03:28:01
I use svg-android.jar from https://github.com/pents90/svg-android at its work fine but only on emulator devices in eclipse. Agrrrr. On real devices it just empty imageView on screen. here is my code: SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.test); Drawable drawable = svg.createPictureDrawable(); imgView.setImageDrawable(drawable); any suggestion? On newer devices that have hardware rendering turned on by default, you need to explicitly turn on software rendering. imgView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); I suspect this is probably your problem. emilpmp Use

ImageView onImageChangedListener Android

岁酱吖の 提交于 2019-11-27 03:23:33
问题 Is there an onImageChangedListener() on a ImageView? I need the event when the image is changed from the ImageView. 回答1: Check the imageview code in grepcode. You don't know when it is changed or redrawn. It is because after you setImageDrawable(), imageview will invalidate. At this time, the image IS NOT CHANGED correctly until ondraw is called. Anyway, why do you want to know the onimagechangedlistener? 回答2: There is no default listener in Android .. but we can create the imagechange

android: create circular image with picasso

徘徊边缘 提交于 2019-11-27 02:59:16
The question had been asked and there had been a promise made for the very version of Picasso that I am using: How do I send a circular bitmap to an ImageView using Picasso? I am new to Picasso and only thing I have used is Picasso.with(context).load(url).resize(w, h).into(imageview); I have already found https://gist.github.com/julianshen/5829333 but I am not sure how to combine it with the line above in a non-awkward way. Anirudh Sharma Research a bit before as there are answers available. Anyhow, follow This Link and read it carefully to know how to use it. try this: import com.squareup

Android ProgressDialog with setContentView

十年热恋 提交于 2019-11-27 02:53:07
问题 I've read a hell of a lot about this, and can't see anyone who's done or tried it before. So I've got an object that extends ImageView, then within this I call a progress dialog and set the progress dialogs's content to the imageview (i.e. attempting to draw the progress dialog in the imageview..view.) loadingProgressDialog.setContentView(this); //this is: LoaderImageView extends ImageView loadingProgressDialog.setIndeterminate(true); loadingProgressDialog.show(); And I get the error:

“The type Gallery is deprecated”, Whats the best alternative?

别来无恙 提交于 2019-11-27 02:42:22
问题 I was really surprised that such a Widget gets deprecated. I want a simple gallery that scrolls left and right, shows a picture on the whole Activity screen, and most important is that you cant swipe more than 1 image in any direction, even if the scroll speed is fast it changes to the next image. So which Widget should I use? Or should I use a simple ImageView and handle all the swipes and add an animation? 回答1: It states in the docs: This widget is no longer supported. Other horizontally

Android: How can I stop an infinite animation applied on an ImageView?

你说的曾经没有我的故事 提交于 2019-11-27 02:04:42
问题 I have an ImageView on which I have applied a rotate animation. Since I want the rotation to go on continuously, I gave the repeatCount as infinite in my rotate.xml: android:repeatCount="infinite" In onCreate(), I load the animation and start it. Animation myAnim = AnimationUtils.loadAnimation(this, R.anim.rotate); objectImg.startAnimation(myAnim); When a button is pressed, the rotation must stop. Hence in my onClick(), I called clearAnimation(). objectImg.startAnimation(myAnim); My simple