本文整理汇总了C++中CAImageView::setFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ CAImageView::setFrame方法的具体用法?C++ CAImageView::setFrame怎么用?C++ CAImageView::setFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAImageView
的用法示例。
在下文中一共展示了CAImageView::setFrame方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTailorImageAtIndex
CAView* CAStepper::getTailorImageAtIndex(int i)
{
CAImageView* imageView = NULL;
CAScale9ImageView* clipNode = CAScale9ImageView::createWithFrame(m_pBackgroundImageView->getBounds());
clipNode->setImage(m_pBackgroundImage[CAControlStateHighlighted]);
DSize size = clipNode->getFrame().size;
CARenderImage* render = CARenderImage::create(size.width, size.height);
render->printscreenWithView(clipNode);
DRect rect;
if (m_pCAStepperOrientation==CAStepperOrientationHorizontal) {
rect.origin = DPoint(i*m_pBackgroundImageView->getBounds().size.width/2,0);
rect.size = DSize(m_pBackgroundImageView->getBounds().size.width/2,m_pBackgroundImageView->getBounds().size.height);
}else{
rect.origin = DPoint(0,i*m_pBackgroundImageView->getBounds().size.height/2);
rect.size = DSize(m_pBackgroundImageView->getBounds().size.width,m_pBackgroundImageView->getBounds().size.height/2);
}
imageView = CAImageView::createWithImage(render->getImageView()->getImage());
imageView->setFrame(rect);
imageView->setImageRect(rect);
return imageView;
}
示例2: createWithFrame
CAImageView* CAImageView::createWithFrame(const CCRect& rect)
{
CAImageView * pRet = new CAImageView();
if (pRet && pRet->init())
{
pRet->setFrame(rect);
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
示例3: viewDidLoad
void FirstViewController::viewDidLoad()
{
// Do any additional setup after loading the view from its nib.
CAImageView* imageView = CAImageView::createWithImage(CAImage::create("9m.jpg"));
imageView->setFrame(CCRect(200, 300, 330, 214));
this->getView()->addSubview(imageView);
CCLabelTTF* ttf = CCLabelTTF::create("Hello World!", "Arial", 50);
ttf->setColor(ccBLACK);
ttf->setFrame(CCRect(200, 450, 0, 0));
this->getView()->addSubview(ttf);
}
示例4: viewDidLoad
void ViewController::viewDidLoad()
{
CAScrollView* scroll = new CAScrollView();
scroll->initWithFrame(this->getView()->getBounds());
this->getView()->addSubview(scroll);
scroll->setViewSize(scroll->getBounds().size * 2);
scroll->setMaximumZoomScale(3.0f);
scroll->setMinimumZoomScale(0.5f);
scroll->setBouncesZoom(false);
CAImageView* v = CAImageView::createWithImage(CAImage::create("1.jpg"));
v->setFrame(CCRect(0, 0, scroll->getViewSize().width, scroll->getViewSize().height));
scroll->addSubview(v);
ccColor3B color = ccRED;
if (this->getTitle().compare("view1") == 0)
{
color = ccBLACK;
}
else if (this->getTitle().compare("view2") == 0)
{
scroll->setMaximumZoomScale(1.0f);
scroll->setMinimumZoomScale(1.0f);
scroll->setBounces(false);
}
else if (this->getTitle().compare("view3") == 0)
{
color = ccYELLOW;
}
else if (this->getTitle().compare("view4") == 0)
{
color = ccGRAY;
scroll->setBounceHorizontal(false);
}
else if (this->getTitle().compare("view5") == 0)
{
color = ccRED;
scroll->setBounces(false);
}
this->getView()->setColor(color);
}
示例5: copy
CAView* CAImageView::copy()
{
CAImageView* pReturn = CAImageView::create();
if (m_bFrame)
{
pReturn->setFrame(this->getFrame());
}
else
{
pReturn->setCenter(this->getCenter());
}
pReturn->setImageViewScaleType(this->getImageViewScaleType());
pReturn->setImage(this->getImage());
pReturn->setColor(this->getColor());
return pReturn;
}
示例6: viewDidLoad
void NoticeDetailViewController::viewDidLoad()
{
// Do any additional setup after loading the view from its nib.
m_winSize = this->getView()->getBounds().size;
CAScale9ImageView* sView = CAScale9ImageView::createWithImage(CAImage::create("common/sky_bg.png"));
sView->setFrame(DRect((0), (0), m_winSize.width, (120)));
this->getView()->addSubview(sView);
CAButton* button = CAButton::createWithFrame(DRect((0), (20), (100), (100)), CAButtonTypeCustom);
CAImageView* imageView = CAImageView::createWithImage(CAImage::create("common/nav_back.png"));
imageView->setImageViewScaleType(CAImageViewScaleTypeFitImageXY);
imageView->setFrame(DRect((20), (20), (80), (80)));
button->setBackgroundViewForState(CAControlStateAll, imageView);
button->addTarget(this, CAControl_selector(NoticeDetailViewController::buttonCallBack), CAControlEventTouchUpInSide);
button->setTag(20);
sView->addSubview(button);
CALabel* label = CALabel::createWithCenter(DRect(m_winSize.width / 2, (70), m_winSize.width, (50)));
label->setTextAlignment(CATextAlignmentCenter);
label->setColor(CAColor_white);
label->setTouchEnabled(false);
label->setFontSize((40));
label->setText("Notice");
label->setFontName(SAP_FONT_ARIAL);
sView->addSubview(label);
label = CALabel::createWithFrame(DRect(0, (200), m_winSize.width, (60)));
label->setTextAlignment(CATextAlignmentCenter);
label->setColor(CAColor_gray);
label->setTouchEnabled(false);
label->setFontSize((40));
label->setText(m_title);
label->setFontName(SAP_FONT_ARIAL);
this->getView()->addSubview(label);
label = CALabel::createWithFrame(DRect(40, (300), m_winSize.width - 80, (800)));
label->setTextAlignment(CATextAlignmentLeft);
label->setColor(CAColor_gray);
label->setTouchEnabled(false);
label->setFontSize((30));
label->setText(m_detail);
label->setFontName(SAP_FONT_ARIAL);
this->getView()->addSubview(label);
CCLog("%f", CAApplication::getApplication()->getWinSize().width);
}
示例7: viewDidLoad
void FirstViewController::viewDidLoad()
{
// Do any additional setup after loading the view from its nib.
CCRect winRect = this->getView()->getBounds();
CAImageView* imageView = CAImageView::createWithImage(CAImage::create("r/HelloWorld.png"));
imageView->setImageViewScaleType(CAImageViewScaleTypeFitImageInside);
imageView->setFrame(winRect);
this->getView()->addSubview(imageView);
CALabel* label = CALabel::createWithCenter(CCRect(winRect.size.width*0.5, winRect.size.height*0.5-270, winRect.size.width, 200));
label->setTextAlignment(CATextAlignmentCenter);
label->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
label->setFontSize(_px(72));
label->setText("Hello World!");
label->setColor(CAColor_white);
this->getView()->insertSubview(label, 1);
}
示例8: viewDidLoad
void SiteViewController::viewDidLoad()
{
// Do any additional setup after loading the view from its nib.
m_winSize = this->getView()->getBounds().size;
CAScale9ImageView* tabBg = CAScale9ImageView::createWithImage(CAImage::create("common/yellow_bg.png"));
tabBg->setCapInsets(DRect(1, 1, 1, 1));
tabBg->setFrame(DRect((0), (0), m_winSize.width, (150)));
this->getView()->addSubview(tabBg);
CAButton* button = CAButton::createWithFrame(DRect((0), (20), (100), (100)), CAButtonTypeCustom);
CAImageView* imageView = CAImageView::createWithImage(CAImage::create("common/nav_back.png"));
imageView->setImageViewScaleType(CAImageViewScaleTypeFitImageXY);
imageView->setFrame(DRect((20), (20), (80), (80)));
button->setBackgroundViewForState(CAControlStateAll, imageView);
button->addTarget(this, CAControl_selector(SiteViewController::buttonCallBack), CAControlEventTouchUpInSide);
button->setTag(20);
this->getView()->addSubview(button);
CALabel* mc = CALabel::createWithFrame(DRect((120), (62), (200), (50)));
mc->setFontSize((40));
mc->setText("Site");
mc->setColor(CAColor_white);
mc->setFontName(SAP_FONT_ARIAL);
this->getView()->addSubview(mc);
imageView = CAImageView::createWithFrame(DRect(0, (150), m_winSize.width, m_winSize.height - (150)));
imageView->setImageViewScaleType(CAImageViewScaleTypeFitImageCrop);
imageView->setImage(CAImage::create("common/site_map.png"));
this->getView()->addSubview(imageView);
button = CAButton::createWithFrame(DRect(m_winSize.width - 100, (50), (50), (50)), CAButtonTypeRoundedRect);
imageView = CAImageView::createWithImage(CAImage::create("common/share_btn.png"));
imageView->setImageViewScaleType(CAImageViewScaleTypeFitViewByHorizontal);
button->setTag(200);
button->setBackgroundViewForState(CAControlStateAll, imageView);
button->addTarget(this, CAControl_selector(SiteViewController::buttonCallBack), CAControlEventTouchUpInSide);
this->getView()->addSubview(button);
requestMsg();
m_pLoading = CAActivityIndicatorView::createWithCenter(DRect(m_winSize.width / 2, m_winSize.height / 2, 50, 50));
m_pLoading->setLoadingMinTime(0.5f);
this->getView()->addSubview(m_pLoading);
CCLog("%f", CAApplication::getApplication()->getWinSize().width);
}
示例9: viewDidLoad
void FirstViewController::viewDidLoad()
{
// Do any additional setup after loading the view from its nib.
DRect winRect = this->getView()->getBounds();
CAImageView* imageView = CAImageView::createWithImage(CAImage::create("r/HelloWorld.png"));
imageView->setImageViewScaleType(CAImageViewScaleTypeFitImageCrop);
imageView->setFrame(winRect);
this->getView()->addSubview(imageView);
DRect rect;
rect.size = DSize(600, 200);
rect.origin = winRect.size/2;
rect.origin.y -= 360;
CALabel* label = CALabel::createWithCenter(rect);
label->setTextAlignment(CATextAlignmentCenter);
label->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
label->setFontSize(72);
label->setText("Hello World!");
label->setColor(CAColor_white);
this->getView()->addSubview(label);
}
示例10: viewDidLoad
void PageMenu::viewDidLoad()
{
g_pCurrentPageMenu = this;
PageBase::viewDidLoad();
CAImageView *pBk = CAImageView::createWithImage(CAImage::create("Bk.png"));
pBk->setFrame( getView()->getFrame() );
getView()->addSubview( pBk );
m_pMenuList = new CATableView();
m_pMenuList->initWithFrame( CCRect( 0 , 0 , getView()->getFrame().size.width , getView()->getFrame().size.height - 120 ) );
m_pMenuList->setTableViewDataSource(this);
m_pMenuList->setTableViewDelegate(this);
m_pMenuList->setTablePullViewHeight( 96 );
//m_pMenuList->setTablePullDownView( CAView::createWithColor( ccc4( 34 , 168 , 109 , 255 ) ) );
m_pMenuList->setTablePullUpView( CAImageView::createWithImage(CAImage::create("MenuDropList.png") ) );
m_pMenuList->setTablePullDownView( CAView::createWithColor( ccc4( 34 , 168 , 109 , 255 ) ) );
getView()->addSubview( m_pMenuList );
m_pMenuList->release();
m_pMenuList->setAllowsSelection( true );
CAImageView *pBk2 = CAImageView::createWithImage(CAImage::create("Bk2.png"));
pBk2->setFrame( CCRect( 0 , getView()->getFrame().size.height - 120 , getView()->getFrame().size.width , 120 ) );
getView()->addSubview( pBk2 );
m_pProgress = CAProgress::create();
m_pProgress->setFrame( CCRect( 0 , -40 , 720 , 44 ) );
//m_pProgress->setProgressTintColor( ccc4( 34 , 168 , 109 , 255 ) );
m_pProgress->setProgressTintColor( ccc4( 255 , 255 , 255 , 255 ) );
m_pProgress->setProgressTintImage( CAImage::create( "DownloadProgress.png" ) );
m_pProgress->setProgresstrackColor( ccc4( 74 , 103 , 92 , 255 ) );
m_pProgress->setVisible( false );
pBk2->addSubview( m_pProgress );
m_pProgressLabel = CALabel::createWithFrame( m_pProgress->getFrame() );
m_pProgressLabel->setColor( ccc4( 255 , 255 , 255 , 255 ) );
m_pProgressLabel->setFontSize( 28 );
m_pProgressLabel->setTextAlignment( CATextAlignmentCenter );
m_pProgressLabel->setVerticalTextAlignmet( CAVerticalTextAlignmentCenter );
pBk2->addSubview( m_pProgressLabel );
// 下载全书
{
CAButton *pButton = CAButton::createWithFrame( CCRect( 64 , 22 , 260 , 88 ) , CAButtonTypeCustom );
pButton->setBackGroundViewForState( CAControlStateNormal , CAScale9ImageView::createWithImage( CAImage::create( "ButtonNormal.png" ) ) );
pButton->setBackGroundViewForState( CAControlStateHighlighted , CAScale9ImageView::createWithImage( CAImage::create( "ButtonLight.png" ) ) );
pButton->setBackGroundViewForState( CAControlStateDisabled , CAScale9ImageView::createWithImage( CAImage::create( "ButtonDisable.png" ) ) );
CALabel *pLabel = CALabel::createWithFrame( CCRect( 0 , 0 , pButton->getFrame().size.width , pButton->getFrame().size.height ) );
pLabel->setText( ("下载全书") );
pLabel->setColor( ccc4( 255 , 255 , 255 , 255 ) );
pLabel->setFontSize( 28 );
pLabel->setTextAlignment( CATextAlignmentCenter );
pLabel->setVerticalTextAlignmet( CAVerticalTextAlignmentCenter );
pButton->addSubview( pLabel );
pBk2->addSubview( pButton );
pButton->addTarget( this , CAControl_selector(PageMenu::OnDownloadAllButtonDown) , CAControlTouchUpInSide );
}
// 章节下载
{
CAButton *pButton = CAButton::createWithFrame( CCRect( 400 , 22 , 260 , 88 ) , CAButtonTypeCustom );
pButton->setBackGroundViewForState( CAControlStateNormal , CAScale9ImageView::createWithImage( CAImage::create( "ButtonNormal.png" ) ) );
pButton->setBackGroundViewForState( CAControlStateHighlighted , CAScale9ImageView::createWithImage( CAImage::create( "ButtonLight.png" ) ) );
pButton->setBackGroundViewForState( CAControlStateDisabled , CAScale9ImageView::createWithImage( CAImage::create( "ButtonDisable.png" ) ) );
CALabel *pLabel = CALabel::createWithFrame( CCRect( 0 , 0 , pButton->getFrame().size.width , pButton->getFrame().size.height ) );
pLabel->setText( ("下载后续章节") );
pLabel->setColor( ccc4( 255 , 255 , 255 , 255 ) );
pLabel->setFontSize( 28 );
pLabel->setTextAlignment( CATextAlignmentCenter );
pLabel->setVerticalTextAlignmet( CAVerticalTextAlignmentCenter );
pButton->addSubview( pLabel );
pBk2->addSubview( pButton );
pButton->addTarget( this , CAControl_selector(PageMenu::OnDownloadButtonDown) , CAControlTouchUpInSide );
}
ShowWait( true );
BookDB::Instance()->GetBookMenu( &m_bookData , this , BookDB_selector(PageMenu::OnComplete) );
}
示例11: addImage
CCObject* CAUIHelper::addImage(CSJson::Value jsonValue, CCRect &uiRect)
{
CAImageView *imageview = CAImageView::createWithImage(CAImage::create(""));
imageview->setFrame(uiRect);
return NULL;
}