96编辑器旗下产品
找图
终身
ID:0
到期时间:永久
退出登录
您的位置:首页 > 百科管理 > 详情

bitmap压缩到指定尺寸-在手机上把图片压缩到1m以下,怎么办

原创:找图网 2023-05-03 04:58:13
  • Bitmap改变大小

  • 用StretchBlt可以放大或缩小bitmap

    The StretchBlt function copies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap to fit the dimensions of the destination rectangle, if necessary. The system stretches or compresses the bitmap according to the stretching mode currently set in the destination device context.

    BOOL StretchBlt(

    HDC hdcDest, // handle to destination DC

    int nXOriginDest, // x-coord of destination upper-left corner

    int nYOriginDest, // y-coord of destination upper-left corner

    int nWidthDest, // width of destination rectangle

    int nHeightDest, // height of destination rectangle

    HDC hdcSrc, // handle to source DC

    int nXOriginSrc, // x-coord of source upper-left corner

    int nYOriginSrc, // y-coord of source upper-left corner

    int nWidthSrc, // width of source rectangle

    int nHeightSrc, // height of source rectangle

    DWORD dwRop // raster operation code

    );

  • Android中压缩图片指定大小

  • 注意看这句话,(, 100, baos);

    那里的数字表示 如果不压缩是100,表示压缩率为0。

    如果是70,就表示压缩率是70,表示压缩30%;

    所以你的倒数第二句话表示没有压缩。

    以下是我压缩的方法,望采纳。

    /**

    * 图像压缩并保存到本地

    * 返回处理过的图片

    *

    */

    private Bitmap

    saveImage(String fileName,Bitmap bit) {

    File file = new

    File(fileName);

    if (!()) {

    try

    {

    ();

    } catch (IOException e)

    {

    e.printStackTrace();

    }

    }

    try

    {

    ByteArrayOutputStream stream = new

    ByteArrayOutputStream();

    (, 70,

    stream);

    // 70 是压缩率,表示压缩30%; 如果不压缩是100,表示压缩率为0

    FileOutputStream os =

    new

    FileOutputStream(file);

    (());

    ();

    return

    bit;

    } catch (Exception e) {

    file = null;

    return

    null;

    }

    }

  • 在手机上把图片压缩到1m以下,怎么办

  • 在手机上用

    美图秀秀

    打开图片,然后另存,把品质降低即可。

    图片是指由图形、图像等构成的平面媒体。图片的格式很多,但总体上可以分为点阵图和

    矢量图

    两大类,我们常用BMP、JPG等格式都是点阵图形,而SWF、CDR、AI等格式的图形属于矢量图形。

    名词解释:

    位图(外语简称:BMP、外语全称:Bitmap),它是Windows操作系统中的标准图像文件格式,能够被多种Windows

    应用程序

    所支持。

    随着Windows操作系统的流行与丰富的Windows应用程序的开发,BMP位图格式理所当然地被广泛应用。这种格式的特点是包含的图像信息较丰富,几乎不进行压缩,但由此导致了它与生俱来的缺点――占用磁盘空间过大,所以,BMP在单机上比较流行。

    最新文章 更多
    最新素材 更多
    公司介绍 网站地图 图片资讯
    Copyright © 2010-2022 山东找图网络科技有限公司  鲁ICP备18007836号-3  邮箱:15653358549@163.com