本文整理汇总了C++中PixelBuffer::getBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ PixelBuffer::getBuffer方法的具体用法?C++ PixelBuffer::getBuffer怎么用?C++ PixelBuffer::getBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PixelBuffer
的用法示例。
在下文中一共展示了PixelBuffer::getBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connect
App::App()
: m_numRows(1)
, m_numCols(1)
, m_drawType(kCircle)
, m_finalImage(0)
{
QmlDocument *qml = QmlDocument::create("main.qml");
qml->setContextProperty("cs", this);
AbstractPane *root = qml->createRootNode<AbstractPane>();
Application::setScene(root);
if (root != 0)
{
TextField* textField = root->findChild<TextField*>("numRows");
connect(textField, SIGNAL(touch(bb::cascades::TouchEvent*)), this, SLOT(onIntFieldTouched(bb::cascades::TouchEvent*)));
connect(textField, SIGNAL(textChanged(QString)), this, SLOT(onNumRowsChanged(QString)));
textField = root->findChild<TextField*>("numCols");
connect(textField, SIGNAL(touch(bb::cascades::TouchEvent*)), this, SLOT(onIntFieldTouched(bb::cascades::TouchEvent*)));
connect(textField, SIGNAL(textChanged(QString)), this, SLOT(onNumColsChanged(QString)));
// Four hard-coded buttons.
// Three select an image from the asset...
Button* button = root->findChild<Button*>("img1");
connect(button, SIGNAL(clicked()), this, SLOT(onImageSelected()));
button = root->findChild<Button*>("img2");
connect(button, SIGNAL(clicked()), this, SLOT(onImageSelected()));
button = root->findChild<Button*>("img3");
connect(button, SIGNAL(clicked()), this, SLOT(onImageSelected()));
// ...and two specify images to draw on demand
button = root->findChild<Button*>("circle");
connect(button, SIGNAL(clicked()), this, SLOT(onCircleSelected()));
button = root->findChild<Button*>("square");
connect(button, SIGNAL(clicked()), this, SLOT(onSquareSelected()));
m_finalImage = root->findChild<ImageView*>("finalImage");
// Set the image on the circle and the square
PixelBuffer pixelBuffer;
button = root->findChild<Button*>("circle");
pixelBuffer = drawCircle(QSize(50,50));
button->setImage(pixelBuffer.getBuffer());
button = root->findChild<Button*>("square");
pixelBuffer = drawSquare(QSize(50,50));
button->setImage(pixelBuffer.getBuffer());
}