# Drawables

Drawables are the images in your application. These images can be in .png, .jpg, .gif, or specified in XML.

You save the files in drawable or a qualified version of the drawable folder and then reference in XML without the extension.

<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
src="@drawable/myimage"/>


Instead of including an image with different densities, you could specify resources in XML and even Java.

For example, to draw a red rectangle, you could create it using XML.

<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@color/Red" />
</shape>


You'd save the file in the drawable/ folder and give it a descriptive name like rectangle.xml. To refer to it in code, you use the same method of referencing:

<View
android:layout_width="80dp"
android:layout_height="20dp"
android:background="@drawable/rectangle"/>


## 9-patch

This is a special file that scales to fill a view. You are able to specify how certain regions stretch and what regions should stay the same.