本文整理汇总了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);
}
示例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";
}
示例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;
}
示例4: CacheReadResponder
CacheReadResponder(const LLUUID& id, LLImageFormatted* image)
: mFormattedImage(image), mID(id)
{
setImage(image);
}
示例5: setImage
void Sprite::applyImage(std::string theImage)
{
setImage(anImage);
}
示例6: setImage
void ImageNode::setImage(float height, const Image& image, const Rect& imageRegion) noexcept
{
setImage(image, imageRegion);
setHeight(height);
}
示例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) );
}
示例8: setImage
void QImageItem::resetImage()
{
setImage(QImage());
}
示例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);
}
}
示例10: setImage
Heightmap::Heightmap(string path)
{
setImage(path);
setTriangleSize(4.0, 40.0, 4.0);
}
示例11: setImage
void ImageLoader::elementWillMoveToNewOwnerDocument()
{
setImage(0);
}
示例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);
}
}
示例13: setImage
void OSCollapsibleItemHeader::setExpanded(bool expanded)
{
m_expanded = expanded;
setImage(m_expanded);
}
示例14: setImage
KisImagePyramid::~KisImagePyramid()
{
setImage(0);
}
示例15: resetHistory
void CMyPaintDoc::clear() {
resetHistory();
setImage(NULL);
setFileImage();
}