Dim PBag As New PropertyBag
Dim B() As Byte
PBag.WriteProperty "Picture",Picture1.Picture
'读取Picture1.Picture 图片并写到 Pbag 容器中
B = PBag.Contents '获取容器Byte 到 B() 数组中
'这时 B 就时我们想要获得的Byte数组
'读取 Byte() 数组内容到 Picture
PBag.Contents = B '指定 PBag容器的内容
'读取容器中的图片
Set Picture1.Picture = PBag.ReadProperty("Picture")