用activex。就是微软里自带的imgedit控件。

解决方案 »

  1.   

    将image的图像 stretch的属性true
    然后你就可以调节image的大小就可以缩放,满屏了
      

  2.   

    //==============================================================================
    //改变图片大小******************************************************************
    //==============================================================================
    procedure FitBitmap(const Source, Target: string; const X, Y:integer; const ColorBit: TPixelFormat);
    var aBMP, bBMP: TBitmap;
        ScaleX, ScaleY: real;
    begin
      aBMP := TBitmap.Create;
      bBMP := TBitmap.Create;
      try
        aBMP.LoadFromFile(Source);
        ScaleY := aBMP.Height/Y;
        ScaleX := aBMP.Width/X;
        bBMP.Width := Round(aBMP.Width/ScaleX);
        bBMP.Height := Round(aBMP.Height/ScaleY);
        bBMP.PixelFormat := pf8bit;
        SetStretchBltMode(bBMP.Canvas.Handle,COLORONCOLOR);
        Stretchblt(bBMP.Canvas.Handle,0,0,bBMP.Width,bBMP.Height,aBMP.Canvas.Handle,0,0,aBMP.Width,aBMP.Height,srccopy);
        bBMP.SaveToFile(Target);
      finally
        aBMP.Free;
        bBMP.Free;
      end;
    end;
      

  3.   

    //==============================================================================
    //在画布上调整图像大小**********************************************************
    //==============================================================================
    procedure StretchBitmap(ImageBMP: TBitmap; Canvas: TCanvas; Rect: TRect);
    var Bits: HBITMAP;
        Info: PBitmapInfo;
        Image: Pointer;
        InfoSize, ImageSize: DWORD;
        DIBWidth, DIBHeight: Longint;
    begin
      try
        Bits := ImageBMP.Handle;
        GetDIBSizes(Bits, InfoSize, ImageSize);
        GetMem(Info, InfoSize);//Info := MemAlloc(InfoSize);
        try
          GetMem(Image, ImageSize);//Image := MemAlloc(ImageSize);
          try
            GetDIB(Bits, 0, Info^, Image^);
            with Info^.bmiHeader do
            begin
              DIBWidth := biWidth;
              DIBHeight := biHeight;
            end;
            StretchDIBits(Canvas.Handle, Rect.Left, Rect.Top, Rect.Right - Rect.Left, Rect.Bottom - Rect.Top, 0, 0, DIBWidth, DIBHeight, Image, Info^, DIB_RGB_COLORS, SRCCOPY);
          finally
            FreeMem(Image, ImageSize);
          end;
        finally
          FreeMem(Info, InfoSize);
        end;
      except
        On E:Exception do
        begin
          raise;
          exit;
        end;
      end;
    end;