一个自定义控件
FItemPic: TBitmap; //添加了一个变量存图片property ItemPic: TBitmap read FItemPic write SetItemPic; //设置了对外procedure T****.SetItemPic(Value: TBitmap); //对外的赋值
begin
  FItemPic.Assign(Value);
end;T****.create;  //控件的创建
FItemPic := TBitmap.Create; T****.Destroy; //控件释放
FItemPic.Free;T****.save;  //保存(这个用于上一步、下一步的操作)还有其他的
WriteItemPic(Stream,ItemPic);T****.load;  //读取(这个用于上一步、下一步的操作)还有其他的
ItemPic.Assign(ReadItemPic(Stream));//以下是保存、读取的两个函数,这两个不知道怎么写???
procedure WriteItemPic(Stream: TStream; const S: TBitmap); //这个有问题
var
  L: Word;
begin
  L := SizeOf(S) { * SizeOf(Char) } ; 
  if L > $FFFF then
    L := $FFFF;
  Stream.WriteBuffer(L, SizeOf(Word));
  if L > 0 then
    Stream.WriteBuffer(S, L);
end;function ReadItemPic(Stream: TStream): TBitmap;        //这个有问题
var
  L: Word;
begin
  Stream.ReadBuffer(L, SizeOf(TBitmap));
//   SetString(Result, PChar(nil), L);
//  SetString(Result, PAnsiChar(nil), L);
  if L > 0 then
    Stream.ReadBuffer(Result, L);
end;