imageview

How to share image of imageview?

柔情痞子 提交于 2019-12-01 08:48:32
I have ImageView and I want to share its image. Following is my code, btshare.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { View content = findViewById(R.id.full_image_view); content.setDrawingCacheEnabled(true); Bitmap bitmap = content.getDrawingCache(); File root = Environment.getExternalStorageDirectory(); File cachePath = new File(root.getAbsolutePath() + "/DCIM/Camera/image.jpg"); try { root.createNewFile(); FileOutputStream ostream = new FileOutputStream(root); bitmap.compress(CompressFormat.JPEG, 100, ostream); ostream.close(); } catch (Exception e)

How to make bitmap transparent?

徘徊边缘 提交于 2019-12-01 08:45:52
/** * @param bitmap * The source bitmap. * @param opacity * a value between 0 (completely transparent) and 255 (completely * opaque). * @return The opacity-adjusted bitmap. If the source bitmap is mutable it * will be adjusted and returned, otherwise a new bitmap is created. * Source : http://stackoverflow.com/questions/7392062/android- * semitransparent-bitmap-background-is-black/14858913#14858913 */ private Bitmap adjustOpacity(Bitmap bitmap, int opacity) { Bitmap mutableBitmap = bitmap.isMutable() ? bitmap : bitmap.copy(Bitmap.Config.ARGB_8888, true); Canvas canvas = new Canvas

Display TextView over ImageView in android

倖福魔咒の 提交于 2019-12-01 08:42:31
I want to display a text over an Image View. I do it like Alesqui suggested here: Android Text over image The preview in Android studio looks fine: But my actual result looks like this with the text unwantedly above: I have to add the following XML dynamically to a LinearLayout during the execution: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/relativelayout" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:id="@+id/myImageView" android:layout_width="wrap_content" android:layout_height="wrap_content"

Touchesbegan not detecting what is being touched

旧街凉风 提交于 2019-12-01 08:30:53
问题 I'm building a rotating banner using a NSTimer to keep track of the current image with the image being animated from 5 different images. I have a touchesBegan set up to keep handle the touch event on the banner if someone clicks it. My proof-of-concept works, but moving it into another project, it breaks. -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [[event allTouches] anyObject]; if ([touch view] == myImageView){ [self getImage]; NSLog(@"%@", currentImage

android imageview scrolling to display full high quality image

送分小仙女□ 提交于 2019-12-01 08:07:56
问题 i am working on displaying an image and placing an icon on top of it... clicking the icon will show an enlarged version of the image... though putting the imageview holding the image in a LinearLayout scales the image to the width of the dialog, the problem is that i need to display the image in a dialog but the image is very high resolution and hence is far bigger than the width of the dialog... I need to show the actual image with scrolling for both ways to see the whole image... But

Android: Replace <img>-tag with ImageViews

守給你的承諾、 提交于 2019-12-01 08:07:39
问题 I'm showing a bit of HTML in a TextView using Html.fromHtml, which works great. Sometimes this html will have img-tags, and I'd also like to display these. I tried Android HTML ImageGetter as AsyncTask but this seemed slow and unpredictable (size of the image). Example HTML (it can differ...): <h2>title</h2><br /><p>TEXT</p> <p style="text-align: center;">Anyways, fokea?.<img src="http://xxxximages/1048268-11-1426170876314.jpg" alt="" /><br /><br /><br /></p> <p>Jo, veldig mye blomster og

Load Image in ImageView from URL stored in JSONString in Android

こ雲淡風輕ζ 提交于 2019-12-01 07:54:10
I have a JSON string, say a name and a Url . I need to extract name into the TextView and extract and display image in ImageView . Below is the code for above scenario. public static final String JSON_STRING="{\"WebImages\":{\"Imagename\":\"image_name\",\"imageurl\":http://www.example.com/image/example.png}}"; I need to display the name in TextView which I created, and fetch the image from that url and display in the Imageview . First of all use Gson to parse Json and get url as a String, then you can use UniversalImageLoader library (it does the async image download and very easy to use)

Android WebView or ImageView?

核能气质少年 提交于 2019-12-01 07:28:38
问题 I have an App that downloads and displays images from URL's. This works fine using URLConnection conn = urls[i].openConnection(); conn.connect(); if(conn.getContentLength() > 0) is = conn.getInputStream(); bis = new BufferedInputStream(is); Bitmap temp = BitmapFactory.decodeStream(bis); I noticed that WebView's download and display images much faster then the above code so I thought i would try. String url = "http:\\image.jpg" int mWidth = getSystemService(Context.WINDOW_SERVICE)

How to share image of imageview?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 06:53:30
问题 I have ImageView and I want to share its image. Following is my code, btshare.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { View content = findViewById(R.id.full_image_view); content.setDrawingCacheEnabled(true); Bitmap bitmap = content.getDrawingCache(); File root = Environment.getExternalStorageDirectory(); File cachePath = new File(root.getAbsolutePath() + "/DCIM/Camera/image.jpg"); try { root.createNewFile(); FileOutputStream ostream = new

How to get URI on imageview with Glide

ぐ巨炮叔叔 提交于 2019-12-01 06:47:37
问题 I'm using 'Glide' to load image from a server to an ImageView. I would like to know if it's possible to extract that URI from the imageview itself. ImageView contentImage = (ImageView) findViewById(R.id.contentImage); ........ Glide.with(getApplicationContext()).load(contentImageUrl) .crossFade() .diskCacheStrategy(DiskCacheStrategy.ALL) .into(contentImage); My aim is to share the image in Imageview. How to get URI on imageview with Glide? Uri uri = ?????????????? Intent shareIntent = new