image file

Android: How to load an image from a file and set on an ImageView

If you’re working with an Android application, this source code seems to work to load an image from a file:

Bitmap bitmap = BitmapFactory.decodeFile(pathToPicture);

The Bitmap and BitmapFactory classes are located in the android.graphics package:

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

Assuming that your pathToPicture is correct, you can then add this bitmap image to an ImageView like this:

A Ruby JPEG example - Use Ruby to get the date and time from a JPEG file

A few weeks ago when I upgraded my iPhone 3G to iOS 4, I hooked up my iPhone to my old Windows computer, where it was originally sync'd. Downloading my iPhone photos onto my Windows XP computer was a pain, and worse than that, in the process, the iPhone photos were pulled off the phone in some random order, so all the photos are completely out of order when I look at them in the Windows Explorer or the Mac Finder.

How to use the Java ImageIO class to read an image file

Wow, I haven't worked with images in Java in a while, and it turns out that opening and reading an image file in Java is very easy these days. Just use the read method of the Java ImageIO class, and you can open/read images in a variety of formats (GIF, JPG, PNG) in basically one line of Java code.