DsgnIntf.dcu缺省是没有的,
你可以的delphi5目录中查找dsgnintf.pas(当然是用windows的
查找功能了), 找到后将此文件拷到delphi5/lib目录就行了
如果是delphi6, 可以查找C:/Program Files/Borland/Delphi6/Source/ToolsAPI/DesignIntf.pas
将此文件改名为dsgnintf.pas, 并打开它将其单元名也改为Dsgnintf再拷到delphi6/lib就行了
——————————————————————————————
调用方法:
EffectGreyScale(Image1.Picture.Bitmap,TempBmp,nil);
Image1.Picture.Bitmap.Assign(TempBMP);
// -----------------------------------------------------------------------------
// Greyscale Bitmap
// Parameter:
// SrcBitmap : Bitmap to be processed
// DestBitmap : Result
// EffectCallBack : CallBack for user interface
// -----------------------------------------------------------------------------
procedure EffectGreyScale(SrcBitmap,DestBitmap:TBitmap;const EffectCallBack:TEffectCallBack);stdcall;
var Row,Col :Integer;
SrcRow,DestRow
RGBArray;
begin
SetBitmapsEql(SrcBitmap,DestBitmap);
for Row:=0 to DestBitmap.Height-1 do
begin
if Assigned(EffectCallBack) then EffectCallBack(0,100,Round((Row/SrcBitmap.Height)*100));
SrcRow:=SrcBitmap.ScanLine[Row];
DestRow:=DestBitmap.ScanLine[Row];
for Col:=0 to DestBitmap.Width-1 do WITH DestRow[Col] do
begin
rgbtBlue:=RgbLightness(SrcRow[Col]);
rgbtGreen:=RgbLightness(SrcRow[Col]);
rgbtRed:=RgbLightness(SrcRow[Col]);
end;
end;
end;
// -----------------------------------------------------------------------------
// RGBLightness
// -----------------------------------------------------------------------------
function RGBLightness(const RGB: TRGBTriple): INTEGER;
var
min: INTEGER;
max: INTEGER;
begin
with RGB DO
MinMaxInt3(rgbtRed, rgbtGreen, rgbtBlue, min, max);
RESULT := (min + max) div 2
end ;
至于JPG如何转成biptmap, 就不用我讲了吧, 你可以在本论坛搜索的