本帖最后由 yct0605 于 2014-01-16 19:13:40 编辑

解决方案 »

  1.   

    嗯,GDI+是可以的,GDI+中就有bicubic resample算法的缩放。
      

  2.   

    例子:http://www.codeproject.com/Articles/11143/Image-Resizing-outperform-GDI
      

  3.   

    下了一个是.net版本的啊,有没有D版本的
      

  4.   

    我写有二线插值算法的BMP位图缩放! 不过不变形估计很难! 图像清晰感觉还行! 
      

  5.   

    参考一下,文字效果不是很好:
    procedure TledMain.ImgZoomIn;
    var
      Bmp:TBitmap;
      backBmp:TBitmap;
    begin
      try
        //动态创建位图
        backBmp:=TBitmap.Create;
        //设置backBmp的宽度和高度
        backBmp.Width:=Image1.Width;
        backBmp.Height:=Image1.Height;
        backBmp.PixelFormat:=pf24bit;  //设置位图为24色位图
        backBmp.Assign(Image1.Picture.Bitmap);    Bmp:=TBitmap.Create;  //产生Tbitmap对象Bmp
        Bmp.PixelFormat:=pf24bit;  //设置bmp为24色位图
        //Image1.AutoSize:=True;
        //缩小图像为原来的0.5倍,Trunc为取整函数
        Bmp.Width:=Trunc(0.5*Image1.Width);
        Bmp.Height:=Trunc(0.5*Image1.Height);
        //保持最大限度不失真
        SetStretchBltMode(Bmp.Canvas.Handle,HALFTONE);
        StretchBlt(Bmp.Canvas.Handle,0,0,Bmp.Width,Bmp.Height,
                   backBmp.Canvas.Handle,0,0,
                   backBmp.Width,backBmp.Height,SRCCOPY);
        Image1.Picture.Bitmap.Assign(Bmp);
        //设置图像居中显示
        Image1.Top:=Self.Height div 2 -bmp.Height div 2;
        Image1.Left:=Self.Width div 2 -bmp.Height div 2;
        Bmp.PixelFormat:=pf24bit;
        Bmp.Free;
        Bmp:=nil;
        backBmp.Free;
        backBmp:=nil;
        Image1.Picture.SaveToFile(CurrentPath+'Out Bmp\led.bmp');
      except
        on e:Exception do
        begin
          SetDlgAutoClose(1000,True);
          application.MessageBox(PChar('分割截图:'+e.Message),'错误',mb_iconstop);      //ListBox1.Items.Clear;
          //ListBox1.Items.Add(e.Message);
          //ListBox1.items.SaveToFile(CurrentPath+FormatDateTime('yyyymmddhhmmss',Now)+'.log');      _stop.Click;
          Application.ProcessMessages;
          _update.Click;
        end;
      end;
    end;
      

  6.   


    这个很简单的,分分钟的事。uses WinAPI.GDIPAPI, WinAPI.GDIPOBJ;var
      Bitmap1: TGPBitmap;
      Bitmap2: TBitmap;
      Graphic: TGPGraphics;
    begin
      Bitmap1 := TGPBitmap.Create('test.bmp');  // bmp, gif, jpeg, png...
      Bitmap2 := TBitmap.Create;
      with Bitmap2 do
        begin
          Width := Bitmap1.GetWidth * 2 div 3;  // shrink to 2/3 width
          Height := Bitmap1.GetHeight * 2 div 3;  // shrink to 2/3 height
          PixelFormat := pf32bit;
        end;
      Graphic := TGPGraphics.Create(Bitmap2.Canvas.Handle);
      Graphic.SetInterpolationMode(InterpolationModeHighQualityBicubic);  // bicubic resample
      Graphic.DrawImage(Bitmap1, 0, 0, Bitmap2.Width, Bitmap2.Height);
      Bitmap2.SaveToFile('test_resized.bmp');
      Graphic.Free;
      Bitmap2.Free;
      Bitmap1.Free;
    end;
      

  7.   

    就像LS那样直接GDI+的又快又方便,除非你自己的算法更快
      

  8.   

    14楼的delphiguy不是给出了代码了么,简单明了就那么几行
      

  9.   

    效果还不是很好,估计需要降噪处理bicubic resample是到目前为止,位图缩放保持原图视觉效果最好的算法了,如果这还不是很好,那你的要求是不可达到的,你可以把“测试还可以”的效果拿出来比较一下。