首页  编辑  

图片分辨率的调整

Tags: /超级猛料/Picture.图形图像编程/图片处理/   Date Created:

]、。·ˉˇ¨〃々—~‖…’”〕〉》」』〗】∶!"'),.:;?]` procedure TForm1.Button1Click(Sender: TObject);

var

abmp,bbmp:tbitmap;

scale:real;

p:tpoint;

begin

abmp:=tbitmap.Create;

bbmp:=tbitmap.Create;

p.x:=10;

p.y:=10;

if open.Execute then

begin

abmp.LoadFromFile(open.FileName);

scale:=abmp.Width/800;

bbmp.Width:=round(abmp.Width/scale);

bbmp.Height:=round(abmp.Height/scale);

bbmp.PixelFormat:=abmp.PixelFormat;

SetStretchBltMode(bbmp.Canvas.Handle,COLORONCOLOR);

//if SetBrushOrgEx(bbmp.Canvas.Handle,0,0,@p) then

 begin

 stretchblt(bbmp.Canvas.Handle,0,0,bbmp.Width,bbmp.Height,abmp.Canvas.Handle,0,0,abmp.Width,abmp.Height,srccopy);

 bbmp.SaveToFile('c:\windows\desktop\aaa.bmp');

 end;

end;

abmp.Free;

bbmp.Free;

end;