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";

  • 相关阅读:
    尝试一下搭博客
    python IO
    python OOP
    杂笔记
    codeforces 217E 【Alien DNA】
    dfs序七个经典问题(转)
    poj 1945 Power Hungry Cows A*
    NOIP 2012 洛谷P1081 开车旅行
    洛谷 P1924 poj 1038
    poj 2176 folding
  • 原文地址:https://www.cnblogs.com/perock/p/2119110.html
Copyright © 2011-2022 走看看