问题补充:procedure Image.SetImage(const Value: TGraphic);var Count, i: integer; CurW, CurH: single; x: integer;begin if FBitmap <> Value then begin if FBitmap <> nil then FBitmap.Free; if (Value is TMetafile) then begin FBitmap := TGraphic(Value.ClassType.Create); end else begin if Value is TBitmap then begin FBitmap := TBitmap.Create; FBitmap.Assign(Value); end; if (Value is TdxPNGImage) then begin FBitmap := TGraphic(Value.ClassType.Create); FBitmap.Assign(Value);//这里将FBitmap建立为TdxPNGImage对象 end; end; end; for i := 0 to High(FB) do if FB <> nil then FB.Free; SetLength(FB, 0); if FBitmap.Width * FBitmap.Height > 0 then begin if (FBitmap is TBitmap) then begin SetLength(FB, 1000); CurW := FBitmap.Width; CurH := FBitmap.Height; FB[0] := TGPBitmap.Create(TBitmap(FBitmap).Handle, TBitmap(FBitmap).Palette); Count := 1; while (CurW > 32) and (CurH > 32) do begin CurW := CurW / 2; CurH := CurH / 2; FB[Count] := FB[0].GetThumbnailImage(Round(CurW), Round(CurH)); x := FB[Count].GetWidth; Inc(Count); end; SetLength(FB, Count); end; if FBitmap is TMetafile then begin SetLength(FB, 1); FB[0] := TGPMetafile.Create(TMetafile(FBitmap).Handle, false); end;{//就是这里,不知怎么处理TdxPNGImage对象?//FB的类型是TGPImage类型 if FBitmap is TdxPNGImage then begin SetLength(FB, 1); FB[0] := TGPImage.Create(TdxPNGImage(FBitmap).,false); end;} end;end;