zoukankan      html  css  js  c++  java
  • Display Images on the report

    add one display images control of Bitmap,but must be write display method oh.

    remark by Jimmy July 2th 2010

     

    show ItemPicture method

    void showItemPicture(InventstdPic _InventstdPic)
    {
        Image               Image     = new Image();
        BinData             BinData   = new BinData();
        container           PicCon;
        real                PicRate;
        filePath            filePath;
        int                 height,width,FixLen;
        name                labelStr;
        #WinAPI
    ;
        FixLen    = 200;
        filePath  = WinAPI::getFolderPath(#CSIDL_INTERNET_CACHE);
        filePath  = _InventstdPic.Filename(filePath);
        PicCon    = _InventStdPic.Images;
    
        Image.setData(PicCon);
        height    = Image.height();
        width     = Image.width();
    
        BinData.setData(PicCon);
        BinData.saveFile(filePath);
    
        if (height > FixLen || width > FixLen)
        {
            if (height > width)
                 PicRate = FixLen / height;
            else
                 PicRate = FixLen / width;
        }
    
        ItemImage.width( width  * PicRate, Units::mm);
        ItemImage.height(height * PicRate, Units::mm);
        if(_InventStdPic.ConfigId)
            labelStr = _InventStdPic.ItemId + " (" + _InventStdPic.ConfigId + ")";
        else
            labelStr = _InventStdPic.ItemId;
        ItemImage.label(labelStr);
        //ItemImage.showPicAsText(Noyes::Yes);
        ItemImage.showLabel(Noyes::Yes);
        ItemImage.imageName(filePath);
    }
    
     

    ItemImage method used to dispaly current the Images.
    display bitMap ItemImage()
    {
        bitMap  bitMap;
    ;
       // bitMap = InventStdPic.Images;

        return  bitMap;
    }

    other

    void ShowImages(InventStdPic _InventStdPic)
    {
        Image               Image;
        BinData             BinData;
        container           Con;
        real                rates,width,height;
        int                 fix;
        filename            _filename;
        filePath            filePath;
        #WINAPI
    
    Filename Filename(FilePath path = '')
    {
        Filename    FilenamePath;
    ;
        if (!_InventStdPic.PicsName)
            return '';
    
        FilenamePath = strfmt("%1%2%3",(strscan(path, '\\',strlen(path),-1)) ? path : path + '\\',
                                        _InventStdPic.PicsName,
                                        _InventStdPic.PicsExtension);
        return FilenamePath;
    }
    
    ;
        fix =50;
        Images.showLabel(false);
        if(_InventStdPic.ImageSize)
        {
            if(_InventStdPic.ImageSize > 4)
                Images.showLabel(true);
            else
            {
                Con   = _InventStdPic.Images;
                Image = new Image();
                Image.setData(Con);
    
                //get and setup the Bitmap control of width and height
                width  = Image.width();
                height = Image.height();
    
                if (width > fix || height > fix)
                {
                    if (height > width)
                         rates = fix / height;
                    else
                         rates = fix / width;
                }
                width  = width  * rates;
                height = height * rates;
                Images.width(width,Units::mm);
                Images.height(height,Units::mm);
    
                //the images container transfer to file path
                BinData  = new BinData();
                BinData.setData(Con);
                filePath =  WinAPI::getFolderPath(#CSIDL_INTERNET_CACHE);
                filePath = Filename(filePath);
                BinData.saveFile(filePath);
    
                //put the field path into the Bitmap control
                Images.imageName(filePath);
            }
        }
    }
    
     
    
    
  • 相关阅读:
    C:表达式、语句、声明
    SAIO Swift All In One Diablo版 安装指南 Alpha
    Python自然语言处理学习笔记(60):7.1 信息抽取
    Python自然语言处理学习笔记(59):练习
    Python自然语言处理学习笔记(62):7.3 开发和评价分块器
    doctest模块的使用说明
    Python自然语言处理学习笔记(61):7.2 分块
    Python自然语言处理学习笔记(57):小结
    使用cURL操作Openstack对象存储的ReST API
    认证系统
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1770048.html
Copyright © 2011-2022 走看看