<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ImageView &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<atom:link href="https://blog.sephiroth.it/tag/imageview/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sephiroth.it</link>
	<description>programmer by pure chance</description>
	<lastBuildDate>Sat, 22 Oct 2022 09:27:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://blog.sephiroth.it/wp-content/uploads/2019/03/cropped-sepy-big-32x32.png</url>
	<title>ImageView &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<link>https://blog.sephiroth.it</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>ImageView Zoom and Scroll</title>
		<link>https://blog.sephiroth.it/2011/04/04/imageview-zoom-and-scroll/</link>
					<comments>https://blog.sephiroth.it/2011/04/04/imageview-zoom-and-scroll/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Mon, 04 Apr 2011 21:31:09 +0000</pubDate>
				<category><![CDATA[android]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[ImageView]]></category>
		<category><![CDATA[scroll]]></category>
		<category><![CDATA[zoom]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=1519</guid>

					<description><![CDATA[Update: the source code has moved to github, so it&#8217;s easier for anyone to fork it! As long as Android doesn&#8217;t have a built-in ImageView widget with zoom and scroll capabilities I tries to create one by myself starting from the google repository. The result is pretty nice so I&#8217;m posting here the source code, &#8230; <a href="https://blog.sephiroth.it/2011/04/04/imageview-zoom-and-scroll/" class="more-link">Continue reading <span class="screen-reader-text">ImageView Zoom and Scroll</span></a>]]></description>
										<content:encoded><![CDATA[<p></p>
<figure><a href="https://blog.sephiroth.it/wp-content/uploads/2011/04/Screen-shot-2011-04-04-at-17.09.04.png"><img decoding="async" title="Screen shot 2011-04-04 at 17.09.04" src="https://blog.sephiroth.it/wp-content/uploads/2011/04/Screen-shot-2011-04-04-at-17.09.04-150x150.png" alt="" /></a></figure>
<p></p>
<p></p>
<p class="wp-block-paragraph"><strong>Update: the source code has moved to <a href="https://github.com/sephiroth74/ImageViewZoom">github</a>, so it&#8217;s easier for anyone to fork it!</strong></p>
<p></p>
<p></p>
<p class="wp-block-paragraph">As long as Android doesn&#8217;t have a built-in <a href="http://developer.android.com/reference/android/widget/ImageView.html">ImageView</a> widget with zoom and scroll capabilities I tries to create one by myself starting from the <a href="http://source.android.com/source/download.html">google repository</a>.</p>
<p></p>
<p></p>
<p class="wp-block-paragraph">The result is pretty nice so I&#8217;m posting here the source code, if anyone is interested, or simply doesn&#8217;t want to waste the time creating a new one.</p>
<p></p>
<p></p>
<p class="wp-block-paragraph">Here&#8217;s a sample code on how to use it in an Activity:</p>
<p></p>
<p></p>
<p class="is-layout-flow wp-block-group-is-layout-flow"></p>
<p class="wp-block-paragraph"> </p>
<p></p>
<p></p>
<p></p>
<p class="wp-block-paragraph">Anyway, if you want to download the source, here is the eclipse source project:<br /><del datetime="2012-06-14T09:20:20+00:00"><a href="https://blog.sephiroth.it/wp-content/uploads/2011/04/ImageZoom.zip">https://blog.sephiroth.it/wp-&#8230;/ImageZoom.zip</a></del><br /><a href="https://github.com/sephiroth74/ImageViewZoom">https://github.com/sephiroth74/ImageViewZoom</a></p>
<p></p><pre>
package it.sephiroth.android.demo;
import it.sephiroth.android.library.imagezoom.ImageViewTouch;
import java.io.IOException;
import android.app.Activity;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore.Images;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;
public class ImageZoomActivity extends Activity {
	private ImageViewTouch mImageView;
	@Override
	protected void onCreate( Bundle savedInstanceState )
	{
		super.onCreate( savedInstanceState );
		requestWindowFeature( Window.FEATURE_NO_TITLE );
		setContentView( R.layout.main );
		getWindow().addFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN );
		selectRandomImage();
	}
	@Override
	public void onContentChanged()
	{
		super.onContentChanged();
		mImageView = (ImageViewTouch)findViewById( R.id.imageView1 );
	}
	/**
	 * pick a random image from your library
	 * and display it
	 */
	public void selectRandomImage()
	{
		Cursor c = getContentResolver().query( Images.Media.EXTERNAL_CONTENT_URI, null, null, null, null );
		if ( c != null ) {
			int count = c.getCount();
			int position = (int)( Math.random() * count );
			if ( c.moveToPosition( position ) ) {
				long id = c.getLong( c.getColumnIndex( Images.Media._ID ) );
				int orientation = c.getInt( c.getColumnIndex( Images.Media.ORIENTATION ) );
				Uri imageUri = Uri.parse( Images.Media.EXTERNAL_CONTENT_URI + "/" + id );
				Bitmap bitmap;
				try {
					bitmap = ImageLoader.loadFromUri( this, imageUri.toString(), 1024, 1024 );
					mImageView.setImageBitmapReset( bitmap, orientation, true );
				} catch ( IOException e ) {
					Toast.makeText( this, e.toString(), Toast.LENGTH_LONG ).show();
				}
			}
			c.close();
			c = null;
			return;
		}
	}
}
</pre>]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2011/04/04/imageview-zoom-and-scroll/feed/</wfw:commentRss>
			<slash:comments>74</slash:comments>
		
		
			</item>
	</channel>
</rss>
