掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
DelphiでSuiseプラグインサンプル (ID:32217)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
お?さん。そこは見たのですが、dcuしか提供されてなくてDel4までの対応ですので無理かな・・・と。 いろいろ検索しまくってやっと見つけました。 以下サンプルを作りましたので、もし参考になれば・・・ ------------- implementationの前に function GetPicture(buf:PChar; len:longint; flag:Cardinal; pHBInfo:PHandle; pHBm:PHandle; lpProgressCallback:Pointer; lData:longint):Integer; stdcall; external 'IFJPEGX.SPI'; //IFJPEGX.SPIは高速JPEGプラグイン procedure JPEG_Load(fname : AnsiString ; Bmp : TBitmap); var hBm,hBmInfo:THandle; pBm:Pointer; pBmInfo:PBitmapInfo; Width, Height: Integer; line :Integer; begin GetPicture(PChar(fname), 0, 0, @hBmInfo, @hBm, nil, 0); pBm := LocalLock(hBm); pBmInfo := LocalLock(hBmInfo); Width := pBmInfo^.bmiHeader.biWidth; Height := pBmInfo^.bmiHeader.biHeight; Bmp.Width := Width; Bmp.Height := Height; line := SetDIBits( Bmp.Canvas.Handle, Bmp.Handle, 0, Height, pBm, pBmInfo^ , DIB_RGB_COLORS ); LocalUnlock(hBm); LocalUnlock(hBmInfo); LocalFree(hBm); LocalFree(hBmInfo); end; procedure TForm2.Button2Click(Sender: TObject); var Bmp: TBitmap; I: Integer; fname :AnsiString; t1,t2: Cardinal; time :Double; begin Bmp := TBitmap.Create; t1 := GetTickCount; for I := 0 to 99 do begin fname := Format('%.3d.jpg',[I]); fname := 'c:\test\' +fname; //c:\test\ に 000.jpg〜099.jpg を置いておく。 JPEG_Load(fname, Bmp); Image1.Picture.Bitmap.Assign(Bmp); Application.ProcessMessages; end; t2 := GetTickCount; time := (t2-t1)/1000.0; label1.Caption :=FormatFloat('0.000秒' ,time); Bmp.Free; end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.