//format jpg to bmp
function toBmp0(jpg: TJpegImage):TBitmap; stdcall;
var
  bmp: TBitmap;
begin
  Bmp := TBitmap.Create;
  Bmp.Assign(jpg);
  toBmp0 := bmp;
end;编译出错,原因delphi2010把TBitmap当成windows.pas下的{ Bitmap Header Definition }
  PBitmap = ^TBitmap;
  {$EXTERNALSYM tagBITMAP}
  tagBITMAP = packed record
    bmType: Longint;
    bmWidth: Longint;
    bmHeight: Longint;
    bmWidthBytes: Longint;
    bmPlanes: Word;
    bmBitsPixel: Word;
    bmBits: Pointer;
  end;
  TBitmap = tagBITMAP;
  {$EXTERNALSYM BITMAP}
  BITMAP = tagBITMAP;
而实际上应该是Graphics