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

  • 相关阅读:
    情书2
    情书1
    python_数据分析_正态分布
    python3调用R语言干货
    常见混淆名词
    PID算法图形 python
    A*寻路算法 python实现
    用tensorflow object detection api做手势识别
    tf识别非固定长度图片ocr(数字+字母 n位长度可变)- CNN+RNN+CTC
    tf识别固定长度验证码图片ocr(0到9 4位)- CNN方式
  • 原文地址:https://www.cnblogs.com/perock/p/2375293.html
Copyright © 2011-2022 走看看