restrict the shape is in bitmap rectangle