imageview

Dynamically change SVG image color in android

百般思念 提交于 2019-11-30 13:54:46
问题 I know that using third party library, it is possible to use SVG image in Android. Library like: svg-android The code to load SVG image is like below: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Create a new ImageView ImageView imageView = new ImageView(this); // Set the background color to white imageView.setBackgroundColor(Color.WHITE); // Parse the SVG file from the resource SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.android);

Android: not displayed ImageView with UIL and TouchImageView

走远了吗. 提交于 2019-11-30 13:10:47
I'm trying to implement load images from a URL with Universal Image Loader and zoom with TouchImageView Mike Ortiz . But when trying to view the image, black screen is displayed. I have checked that the URLs are correct. I if I see a TextView there... What am I doing wrong? ImagePagerActivity.java public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_fullscreen_view); Bundle bundle = getIntent().getExtras(); assert bundle != null; String[] imageUrls = bundle.getStringArray("urls

How do I make my ImageView a fixed size regardless of the size of the bitmap

我怕爱的太早我们不能终老 提交于 2019-11-30 12:28:17
问题 So I'm loading images from a web service, but the size of the images are sometimes smaller or bigger than other images and the visualization looks silly when I put them in a ListView in android. I'd like to fix the size of my ImageView so that it only shows a portion of the image if it's larger than a preset amount. I've tried everything I can think of setting the setMaxWidth/setMaxHeight, setting the scale type to centerCrop, using ClipableDrawable wrapping my BitmapDrawable, setting using

Android Set ImageView image src in Style

拜拜、爱过 提交于 2019-11-30 11:46:48
I need to set the ImageView's src within my style, but I cant find a good example of anyone doing this and when I try the below code, it crashes the app. <ImageView android:src="@style/TitleBarImage"></ImageView> <style name="TitleBarImage"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:src">@drawable/whiteButton</item> </style> This should be simple. What gives? Your xml is incorrect: <ImageView style="@style/TitleBarImage" /> And styles.xml : <style name="TitleBarImage"> <item name="android:layout_width">wrap

Draw Rectangle Over ImageView for highlight that can be zoom in-out in android

こ雲淡風輕ζ 提交于 2019-11-30 11:34:18
问题 I have been refer this example from SO below are they. 1.Draw Line Over ImageView 2.Draw Picture Over ImageView 3.I have use this ImageView Class for my image to become zoom in-out Image Pinch zoom code google. Now what i am try to do is : I want to make zoom in by pinching the screen and other point is that when i do single tap a rectangle should be drawn over image view and i also want this rectangle should get zoom in & out with imageView's Zoom in and Zoom Out and i want to use it through

What's the difference between CENTER_INSIDE and FIT_CENTER scale types?

一世执手 提交于 2019-11-30 10:07:55
问题 I can't tell the difference between ImageView.ScaleType.CENTER_INSIDE and ImageView.ScaleType.FIT_CENTER . CENTER_INSIDE Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding). FIT_CENTER Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit

Can I Add GIF format Image as a Splash Screen

扶醉桌前 提交于 2019-11-30 09:46:45
How can i add GIF format image as a splash screen. I tried to add but when i add it. It acts as a normal image. I don't know whether we can use Gif image as splash Screen. if there is any option to work that GIF format image. Ironman Yes, you can Add Gif Image for the Splash Screen. To use Gif Image in your View. add this dependency to your build.gradle file in the app module. For the latest version. dependencies { compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.10' } and In the XML file add this way <pl.droidsonroids.gif.GifTextView android:layout_width="match_parent" android:layout

Display image from URL - sizing and screen orientation problems

独自空忆成欢 提交于 2019-11-30 09:45:33
I am trying to display an image from a URL, which may be larger than the screen dimensions. I have it kind of working, but I would like it to scale to fit the screen, and I also have problems when the screen orientation changes. The image is tiny, and I would like it to scale its width to the screen as well. (In both cases, I would like the image to fill the screen width with scrollbars (if necessary for height). Here is my ImageView: <ImageView android:id="@+id/ImageView01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scaleType="fitCenter" android

Android: Rotate image in ImageView by 90degrees but without delay

落花浮王杯 提交于 2019-11-30 09:16:55
I am developing a game where a user needs to tap on the image in ImageView to rotate it. On each tap image rotates by 90 degrees in clockwise direction. But image is taking time to rotate from old to new position. This is hampering the gameplay experience. I have used the following: protected void onCreate(Bundle savedInstanceState) { ... ... imgview = (ImageView)findViewById(R.id.imageView1); imgview.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { Matrix matrix = new Matrix(); matrix.postRotate(90); Bitmap myImg = getBitmapFromDrawable(imgview.getDrawable

Video is not pausing in fragment ViewPager

别来无恙 提交于 2019-11-30 09:15:39
I am using View Pager with fragment to showing image and video, I am able to show image and video properly but I have problem, when I swipe for video, then video is playing, but I swipe next or previous then video is still playing on just next or previous screen but when I move two slide next or previous then video is being stop, but why not on next or previous slide. I search it more but I did not get any solution, any help will be appreciable. Thanks in advance. Here is my code: This is Fragment Class public class ContentFragment extends Fragment { private final String imageResourceId;