zoukankan      html  css  js  c++  java
  • ShowBitMap

    static FormWindowControl showBitmap(FormWindowControl _control, Bitmap _bitmap,
                                       int _width=0, int _height=0)
    {
        real    ratio;
        Image   _image;
        ;
        if (_bitmap != connull())
            {
            _image = new Image();
            _image.setData(_bitmap);

            if (_width == 0 && _height == 0) // use default image hxw if no width or height pass in
                {
                _width = _image.width();
                _height = _image.height();
                }
            else // max width or height in not 0 is passed in
                {
                ratio = _image.width() > _image.height() ? _image.width() / _width : _image.height() / _height;

                _width = real2int(_image.width()/ratio);
                _height = real2int(_image.height()/ratio);

                _image.resize(_width, _height, InterpolationMode::InterpolationModeHighQuality);
                }

            _control.width(_width);
            _control.height(_height);
            _control.imagemode(0);
            _control.image(_image);
            }
        else
            {
            _control.imageResource(0);
            }

        return _control;
    }

  • 相关阅读:
    Maven中profile和filtering实现多个环境下的属性过滤
    Java 非法字符: 65279的解决办法
    MySQL军规
    php 时间日期函数
    函数的引入
    linux下修改mysql版本5.7 修改默认字符集
    mysql语句规范
    永久修改mysql提示符
    复杂函数
    函数的特性
  • 原文地址:https://www.cnblogs.com/perock/p/2375293.html
Copyright © 2011-2022 走看看