Serializing bitmaps and rectangles.