Render the captured image in a box.

Signed-off-by: Tengda Yan <yantd@qq.com>
Fix memory leak issue.

Signed-off-by: Tengda Yan <yantd@qq.com>