zoukankan      html  css  js  c++  java
  • 从数据库和文件夹中读取图片并且resize

    从数据库和文件夹中读取图片并且resize

    container           c,cImage;

        str                 PicfileName;

        int                 w,h,tmp;

        real                bmpW = bmp1.widthValue(),bmpH = bmp1.heightValue();

        image               img = new image();

        Act_DesignNoTable   Act_DesignNoTable;

        DocuImgS            DocuImgS;

        binData             Bin = new BinData();

        ;

        if (!_itemid && !_ACT_DesignNo)

        return c;

        PicfileName = DocuRef::NJ_findRefId_Sketch(TableNum(Act_DesignNoTable),

        Act_DesignNoTable::find(InventTable::find(_itemid).ACT_DesignNo).RecId).completeFilename();

        if (winapi::fileExists(PicfileName))

        {

            img.loadImage(PicfileName);

        }

         else

         {

            cImage = DocuImgS::getBitmap(tablenum(Act_DesignNoTable), Act_DesignNoTable::find(_ACT_DesignNo).RecId);

            if (conlen(cImage) > 0)

                img.setData(cImage);

            else

                return c;

         }

            w = img.width();

            h = img.height();

            tmp = img.size();

            if (w>h)

            {

                  img.resize(138,138/(w/h),interpolationMode::InterpolationModeHighQuality);

            }

            else

            {

                  img.resize(138*(w/h),138,interpolationMode::InterpolationModeHighQuality);

            }

            return img.getData();

    -----------------------------

    date2str(ACT_InvoiceTable.InvoiceDate,123,2,1,3,1,4) +"\n";

  • 相关阅读:
    javascript 日期月份加减
    ActiveRecord 的类型初始值设定项引发异常
    angularjs $q、$http 处理多个异步请求
    angular.foreach 格式
    PHP基础知识2
    第一个月的学习总结
    JavaScript的学习5
    JavaScript的学习4
    JavaScript的学习3
    JavaScript的学习2
  • 原文地址:https://www.cnblogs.com/perock/p/2119110.html
Copyright © 2011-2022 走看看