如果??
我试过image1.canvas.pixel但只能用于bmpGetPixel(getdc(image1.canvas.Handle,x,y)  也不行
谢谢大虾,图片只能是jpg
关于放大缩小有没有其它好的办法。只用过image1.trunc(image1.Height * 放大缩小系数))

解决方案 »

  1.   

    有api函数的,具体是那个忘记了,你搜索一下。
      

  2.   

    我用getpixel取到的颜色是黑的.
      

  3.   

    转化成未压缩格式(BMP)处理得了呗。我也曾经试过,这是最后的办法
    或者使用ImageEn图形控件。
      

  4.   

    除了变成BMP,我还真的不会。
    gz
      

  5.   

    只能转成BMP才行.没有别的办法.
      

  6.   

    分辩率很高,换成bmp速度会慢很多.
      

  7.   

    procedure TForm1.Button1Click(Sender: TObject);
    (*压缩MBP为JPEG;但是没有提供压缩比可选项
    凑合用吧,大概1/3 ^_^:
    Note:必须加上JPEG到Uses单元
    *)
    var
    MyJPEG : TJPEGImage;
    MyBMP : TBitmap;
    begin
    MyBMP := TBitmap.Create;
    with MyBMP do
    try
    LoadFromFile('e:\lm.BMP'); //你的图片位置
    MyJPEG := TJPEGImage.Create;
    with MyJPEG do begin
    Assign(MyBMP);
    CompressionQuality:=10; //压缩比例
    Compress;
    SaveToFile('e:\lm01.JPEG');//保存路径……
    Free;
    end;
    finally
    Free;
    end;
    end;--------------------------------------------------------------------------------
    By Luiz Vaz - [email protected] function Bmp2Jpg(Bmp: TBitmap; Quality: Integer = 100): TJpegImage; begin   Result := nil;   if Assigned(Bmp)   then begin   Result := TJpegImage.Create;   Result.Assign(Bmp); {Its all folks...}   Result.CompressionQuality := Quality;   Result.JPEGNeeded; {Key method...}   Result.Compress;   end;end; function Jpg2Bmp(Jpg: TJpegImage): TBitmap; begin   Result := nil;   if Assigned(Jpg)   then begin   Result := TBitmap.Create;   Jpg.DIBNeeded; {Key method...}   Result.Assign(Jpg); {Its all folks...}   end; end; 注意:JPEGNeeded过程转换并存储图像数据到内部的JPEG数据。我们无法直接存取JPEG 内部数据,因为D5并没有提供jpeg.pas单元的源码。但是可以通过JPEGNeeded和DIBNeeded过程来操作它。 
      

  8.   

    我想直接获得image1的句柄然后用Bitblt抓图到一个bitmap再判断会快一些