zoukankan      html  css  js  c++  java
  • BMP2JPG,JPG2BMP

    BMP2JPG,JPG2BMP

    代码
    //uses jpeg
    procedure BMP2JPG(const BMPFile: string);
    var
    BMP: TBitmap;
    JPG: TJpegImage;
    FileName:
    string;
    begin
    FileName :
    = BMPFile;
    BMP :
    = TBitmap.Create;
    JPG :
    = TJpegImage.Create;
    try
    BMP.LoadFromFile(FileName);
    JPG.Assign(BMP);
    FileName :
    = ChangeFileExt(FileName, '.jpg');
    JPG.SaveToFile(FileName);
    finally
    BMP.Free;
    JPG.Free;
    end;
    end;

    procedure JPG2BMP(const JPGFile: string);
    var
    BMP: TBitmap;
    JPG: TJpegImage;
    FileName:
    string;
    begin
    FileName :
    = JPGFile;
    BMP :
    = TBitmap.Create;
    JPG :
    = TJpegImage.Create;
    try
    JPG.LoadFromFile(FileName);
    BMP.Assign(JPG);
    FileName :
    = ChangeFileExt(FileName,'.bmp');
    BMP.SaveToFile(FileName);
    finally
    BMP.Free;
    JPG.Free;
    end;
    end;

  • 相关阅读:
    leetcode
    Vim i和a差别
    HDU-4643-GSM(DFS)
    使用可编程电源自动化输出电源
    如何使用全局变量
    异步和同步
    启动界面
    鼠标右键弹出菜单
    Qt+excel
    Qt+数据库
  • 原文地址:https://www.cnblogs.com/Jekhn/p/1918713.html
Copyright © 2011-2022 走看看