当前位置: 首页>>代码示例>>C++>>正文


C++ setImage函数代码示例

本文整理汇总了C++中setImage函数的典型用法代码示例。如果您正苦于以下问题:C++ setImage函数的具体用法?C++ setImage怎么用?C++ setImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setImage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setImage

void TSpriteIcon::draw(gcn::Graphics *graphics){
    if( (sprite_ != NULL) && (!frames_.empty()) ){
        setImage( frames_.at(sprite_->getFrameProgression()) );
    }
    gcn::Icon::draw(graphics);
}
开发者ID:hoodwolf,项目名称:Infraelly,代码行数:6,代码来源:TSpriteIcon.cpp

示例2: caRowColMenu

caRelatedDisplay::caRelatedDisplay(QWidget *parent) : caRowColMenu(parent)
{
    setImage("fileopen.png");
    setStacking(Row);
    replacemodes << "false" << "false" << "false" << "false" << "false" << "false" << "false" << "false" << "false" << "false"<< "false" << "false" << "false" << "false" << "false" << "false";
}
开发者ID:SLAC-Advanced-Control-Systems,项目名称:caqtdm,代码行数:6,代码来源:carelateddisplay.cpp

示例3: setFileName

bool NAMFFmpegImageStream::open(const std::string & filename)
{
    setFileName(filename);

    if (! m_decoder->open(filename))
        return false;

    //setImage(
    //    m_decoder->video_decoder().width(), m_decoder->video_decoder().height(), 1, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE,
    //    const_cast<unsigned char *>(m_decoder->video_decoder().image()), NO_DELETE
    //);

   // OpenCV Image creation
   //cvNamedWindow( "Test", 0 );
   //cvResizeWindow("Test", m_decoder->video_decoder().width(), m_decoder->video_decoder().height());

   // According to previous line the number of channels is 4: RGBA
   _nbChannels = 4;
   _opencvImage = cvCreateImage(cvSize(m_decoder->video_decoder().width(), m_decoder->video_decoder().height()), IPL_DEPTH_8U, _nbChannels);
   
   
   //TEST
   createIplImageFromGLimage(const_cast<unsigned char *>(m_decoder->video_decoder().image()));
   
   process(_opencvImage);
   //OpenCV_to_OSG(_opencvImage,this);
   setImage(
            m_decoder->video_decoder().width(), m_decoder->video_decoder().height(), 1, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE,
            (unsigned char*)(_opencvImage->imageData), NO_DELETE
            );
   /*setImage(
            m_decoder->video_decoder().width(), m_decoder->video_decoder().height(), 1, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE,
            //(unsigned char*)(_opencvImage->imageData), NO_DELETE
            _movieImage->data(),NO_DELETE
            );*/
   
   // END TEST
   
   
   
    setPixelAspectRatio(m_decoder->video_decoder().pixelAspectRatio());

    OSG_NOTICE<<"ffmpeg::open("<<filename<<") size("<<s()<<", "<<t()<<") aspect ratio "<<m_decoder->video_decoder().pixelAspectRatio()<<std::endl;

#if 1
    // swscale is reported errors and then crashing when rescaling video of size less than 10 by 10.
    if (s()<=10 || t()<=10) return false;
#endif

    m_decoder->video_decoder().setUserData(this);
    m_decoder->video_decoder().setPublishCallback(publishNewFrame);

    /*if (m_decoder->audio_decoder().validContext())
    {
        OSG_NOTICE<<"Attaching FFmpegAudioStream"<<std::endl;

       getAudioStreams().push_back(new osgFFmpeg::FFmpegAudioStream(m_decoder.get()));
    }*/

    _status = PAUSED;
    applyLoopingMode();

    start(); // start thread

    return true;
}
开发者ID:SPhoenixx,项目名称:NAM,代码行数:66,代码来源:NAM-FFmpegImageStream.cpp

示例4: CacheReadResponder

	CacheReadResponder(const LLUUID& id, LLImageFormatted* image)
		: mFormattedImage(image), mID(id)
	{
		setImage(image);
	}
开发者ID:OS-Development,项目名称:VW.Singularity,代码行数:5,代码来源:llviewerobjectbackup.cpp

示例5: setImage

void Sprite::applyImage(std::string theImage)
{
	setImage(anImage);
	
}
开发者ID:asian182,项目名称:Daniel,代码行数:5,代码来源:Sprite.cpp

示例6: setImage

void ImageNode::setImage(float height, const Image& image, const Rect& imageRegion) noexcept
{
    setImage(image, imageRegion);
    setHeight(height);
}
开发者ID:GValiente,项目名称:torrijas,代码行数:5,代码来源:trjimagenode.cpp

示例7: QGraphicsWidget

UpcomingEventsWidget::UpcomingEventsWidget( const LastFmEventPtr &event,
                                            QGraphicsItem *parent,
                                            Qt::WindowFlags wFlags )
    : QGraphicsWidget( parent, wFlags )
    , m_mapButton( 0 )
    , m_urlButton( 0 )
    , m_image( new QLabel )
    , m_event( event )
{
    setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );

    m_image->setText( i18n("Loading picture...") );
    m_image->setAttribute( Qt::WA_NoSystemBackground );
    m_image->setAlignment( Qt::AlignCenter );
    m_image->setFixedSize( 128, 128 );
    QGraphicsProxyWidget *imageProxy = new QGraphicsProxyWidget( this );
    imageProxy->setWidget( m_image );

    m_attendance   = createLabel();
    m_date         = createLabel();
    m_location     = createLabel();
    m_name         = createLabel();
    m_participants = createLabel();
    m_tags         = createLabel();
    m_venue        = createLabel();

    QGraphicsLinearLayout *buttonsLayout = new QGraphicsLinearLayout( Qt::Horizontal );
    buttonsLayout->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed );
    if( event && event->venue() && event->venue()->location )
    {
        QPointF geo( event->venue()->location->longitude, event->venue()->location->latitude );
        if( !geo.isNull() )
        {
            m_mapButton = new Plasma::PushButton( this );
            m_mapButton->setMaximumSize( QSizeF( 22, 22 ) );
            m_mapButton->setIcon( KIcon("edit-find") ); // TODO: a map icon would be nice
            m_mapButton->setToolTip( i18n( "View map" ) );
            buttonsLayout->addItem( m_mapButton );
        }
    }

    if( event && event->url().isValid() )
    {
        m_urlButton = new Plasma::PushButton( this );
        m_urlButton->setMaximumSize( QSizeF( 22, 22 ) );
        m_urlButton->setIcon( KIcon("applications-internet") );
        m_urlButton->setToolTip( i18n( "Open Last.fm webpage for this event" ) );
        connect( m_urlButton, SIGNAL(clicked()), this, SLOT(openUrl()) );
        buttonsLayout->addItem( m_urlButton );
    }

    QSizePolicy::Policy minPol = QSizePolicy::Minimum;
    QGraphicsWidget *supportLabel, *venueLabel, *locationLabel, *dateLabel, *attendLabel, *tagsLabel;
    supportLabel  = createLabel( i18nc("@label:textbox Supporing acts for an event", "Supporting:"), minPol );
    venueLabel    = createLabel( i18nc("@label:textbox", "Venue:"), minPol );
    locationLabel = createLabel( i18nc("@label:textbox", "Location:"), minPol );
    dateLabel     = createLabel( i18nc("@label:textbox", "Date:"), minPol );
    attendLabel   = createLabel( i18nc("@label:textbox", "Attending:"), minPol );
    tagsLabel     = createLabel( i18nc("@label:textbox", "Tags:"), minPol );

    QGraphicsGridLayout *infoLayout = new QGraphicsGridLayout;
    infoLayout->addItem( supportLabel, 0, 0 );
    infoLayout->addItem( venueLabel, 1, 0 );
    infoLayout->addItem( locationLabel, 2, 0 );
    infoLayout->addItem( dateLabel, 3, 0 );
    infoLayout->addItem( attendLabel, 4, 0 );
    infoLayout->addItem( tagsLabel, 5, 0 );
    infoLayout->addItem( m_participants, 0, 1 );
    infoLayout->addItem( m_venue, 1, 1 );
    infoLayout->addItem( m_location, 2, 1 );
    infoLayout->addItem( m_date, 3, 1 );
    infoLayout->addItem( m_attendance, 4, 1 );
    infoLayout->addItem( m_tags, 5, 1 );

    QGraphicsGridLayout *layout = new QGraphicsGridLayout;
    layout->addItem( imageProxy, 0, 0, 2, 1, Qt::AlignCenter );
    layout->addItem( m_name, 0, 1 );
    layout->addItem( buttonsLayout, 0, 2, Qt::AlignRight );
    layout->addItem( infoLayout, 1, 1, 1, 2 );
    setLayout( layout );

    QString name = event->name();
    if( event->isCancelled() )
        name = i18nc( "@label:textbox Title for a canceled upcoming event", "<s>%1</s> (Canceled)", name );
    setName( name );
    setDate( event->date() );
    setLocation( event->venue()->location );
    setVenue( event->venue() );
    setAttendance( event->attendance() );
    setParticipants( event->participants() );
    setTags( event->tags() );
    setImage( event->imageUrl(LastFmEvent::Large) );
}
开发者ID:ErrAza,项目名称:amarok,代码行数:93,代码来源:UpcomingEventsWidget.cpp

示例8: setImage

void QImageItem::resetImage()
{
    setImage(QImage());
}
开发者ID:derjasper,项目名称:ScannerApp,代码行数:4,代码来源:qimageitem.cpp

示例9: switch

void NovelLayer::playNext() {
    // 次のアクションセット取得
    auto actions = this->_player->popNextActions();
    if (actions->empty() || actions == NULL) {
        // アクションが無いのでシーン終了
        this->endScene();
    } else {
        int rootActionIdx = this->beginAction();
        // 取得したアクションを実行する
        for (auto action : *actions) {
            switch (action->getType()) {
                case NovelAction::Type::Set:
                    setImage(action);
                    break;
                case NovelAction::Type::Name:
                    setNameImage(action);
                    break;
                case NovelAction::Type::Speak:
                case NovelAction::Type::Narration:
                    this->updateSpeechBalloon(action);
                    break;
                case NovelAction::Type::Delay:
                    this->playDelay(action);
                    break;
                case NovelAction::Type::Shake:
                    break;
                case NovelAction::Type::Wait:
                    this->playWait();
                    break;
                case NovelAction::Type::Clear:
                    this->clearBalloons();
                    break;
                case NovelAction::Type::ShowImage:
                    this->showItem(action, true);
                    break;
                case NovelAction::Type::ShowImageInstant:
                    this->showItem(action, false);
                    break;
                case NovelAction::Type::HideImage:
                    this->hideItem(true);
                    break;
                case NovelAction::Type::HideImageInstant:
                    this->hideItem(false);
                    break;
                case NovelAction::Type::Music:
                    if (action->getValue() == "fadeout") {
                        SoundManager::getInstance()->fadeOutBgm(1.0f);
                    } else {
                        SoundManager::getInstance()->playBgm(action->getValue());
                    }
                    break;
                case NovelAction::Type::Effect:
                    SoundManager::getInstance()->playEffect(action->getValue());
                    break;
                default:
                    break;
            }
        }
        this->completeAction(rootActionIdx);
    }
}
开发者ID:ken4500,项目名称:zoo,代码行数:61,代码来源:NovelLayer.cpp

示例10: setImage

Heightmap::Heightmap(string path)
{
    setImage(path);
    setTriangleSize(4.0, 40.0, 4.0);
}
开发者ID:SimonRhys,项目名称:Heightmap,代码行数:5,代码来源:Heightmap.cpp

示例11: setImage

void ImageLoader::elementWillMoveToNewOwnerDocument()
{
    setImage(0);
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:4,代码来源:ImageLoader.cpp

示例12: FWARNING

void FileGrabForeground::draw(DrawActionBase *action, Viewport *port)
{
    if(getActive() == false)
        return;
    
    if(getName().empty())
    {
        FWARNING(("FileGrabForeground::draw: no name ?!?\n"));
        return;
    }
    
    Image::PixelFormat pixelFormat = (Image::PixelFormat)getPixelFormat();
    pixelFormat = (pixelFormat == 0) ? Image::OSG_RGB_PF : pixelFormat;
    
    // do we have an image yet? If not, create one.
    if(getImage() == NullFC)
    {
        beginEditCP(this->getPtr(), FileGrabForeground::ImageFieldMask);
        {
			ImagePtr iPtr = Image::create();
			
			iPtr->set(pixelFormat, 1);
			
            setImage(iPtr);
        }
        endEditCP  (this->getPtr(), FileGrabForeground::ImageFieldMask);
    }
    else if(getImage()->getPixelFormat() != pixelFormat)
    {
        ImagePtr iPtr = getImage();
        
        beginEditCP(iPtr, Image::PixelFormatFieldMask);
        {
            iPtr->reformat(pixelFormat);
        }
        endEditCP  (iPtr, Image::PixelFormatFieldMask);
    }
    
    // read pixels
    Inherited::draw(action,port);
    
    Char8 *name = new Char8 [ getName().size() + 32 ]; // this is really 
                                                       // arbitrary... :(

    sprintf(name, getName().c_str(), getFrame());
    
    ImagePtr i = getImage();

    i->write(name);
    
    delete [] name;
    
    if(getIncrement() != false)
    {
        beginEditCP(this->getPtr(), FileGrabForeground::FrameFieldMask);
        {
            setFrame(getFrame() + 1);
        }
        endEditCP  (this->getPtr(), FileGrabForeground::FrameFieldMask);
    }   
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:61,代码来源:OSGFileGrabForeground.cpp

示例13: setImage

void OSCollapsibleItemHeader::setExpanded(bool expanded)
{
  m_expanded = expanded;
  setImage(m_expanded);
}
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:5,代码来源:OSCollapsibleItemHeader.cpp

示例14: setImage

KisImagePyramid::~KisImagePyramid()
{
    setImage(0);
}
开发者ID:KDE,项目名称:calligra-history,代码行数:4,代码来源:kis_image_pyramid.cpp

示例15: resetHistory

void CMyPaintDoc::clear() {
  resetHistory();
  setImage(NULL);
  setFileImage();
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:5,代码来源:MyPaintDoc.cpp


注:本文中的setImage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。