zoukankan      html  css  js  c++  java
  • resize

    void resize()
    {
        ;
        if (toWidth > toHeight)
        {
            if(orgHeight > orgWidth)
            {
                retHeight = toHeight;
                retWidth = orgWidth / orgHeight * toHeight;

            }
            if (orgHeight < orgWidth)
            {

                if (orgHeight / orgWidth * toWidth > toHeight)
                {
                    retHeight = toHeight;
                    retWidth = orgWidth / orgHeight * toHeight;

                }
                else
                {
                    retWidth = toWidth;
                    retHeight = orgHeight /orgWidth * toWidth;
                }

            }
            if (orgHeight == orgWidth)
            {
                retHeight = toHeight;
                retWidth = orgWidth / orgHeight * toHeight;
            }
        }

        if (toWidth < toHeight)
        {
            if(orgHeight > orgWidth)
            {
                if (orgWidth / orgHeight * toHeight > toWidth)
                {
                    retWidth = toWidth;
                    retHeight = orgHeight / orgWidth * toWidth;
                }
                else
                {
                    retHeight = toHeight;
                    retWidth = orgWidth / orgHeight * toHeight;
                }
            }
            if (orgHeight < orgWidth)
            {
                retWidth = toWidth;
                retHeight = orgHeight / orgWidth * toWidth;
            }
            if (orgHeight == orgWidth)
            {
                retWidth = toWidth;
                retHeight = orgHeight / orgWidth * toWidth;
            }
        }

        if (toWidth == toHeight)
        {
            if(orgHeight > orgWidth)
            {
                retHeight = toHeight;
                retWidth = orgWidth / orgHeight * toHeight;
            }
            if (orgHeight < orgWidth)
            {
                retWidth = toWidth;
                retHeight = orgHeight / orgWidth * toWidth;
            }
            if (orgHeight == orgWidth)
            {
                retHeight = toHeight;
                retWidth  = toWidth;

            }
        }

    }

  • 相关阅读:
    APP端上传文件至服务器后台,WEB端上传文件存储到服务器
    freemarker模板引擎
    JEECG开发总结
    spring的基本配置
    jeecg解析xml文件
    jeecg查询备份
    jeecg 页面标签规则
    jeecg查询分页
    算法实践——改良的求解数独的暴力搜索法
    算法实践——舞蹈链(Dancing Links)算法求解数独
  • 原文地址:https://www.cnblogs.com/perock/p/2555878.html
Copyright © 2011-2022 走看看