This example requires Qt5 >= 5.9 setup for building.
17#include <QApplication>
27#include <cvb/ui/image_view_item.hpp>
28#include <cvb/device_factory.hpp>
29#include <cvb/image.hpp>
30#include <cvb/async/single_stream_handler.hpp>
32int main(
int argc,
char* argv[])
48 context->setContextProperty(
"mainImage", &imageController);
54 auto device =
Cvb::DeviceFactory::Open(Cvb::InstallPath() + CVB_LIT(
"drivers/CVMock.vin"), Cvb::AcquisitionStack::Vin);
61 auto stream = device->Stream();
static std::unique_ptr< SingleStreamHandler > Create(const Driver::StreamPtr &stream)
Create a stream handler object.
Definition: decl_single_stream_handler.hpp:46
Handler guard object to safely run and finish a stream handler.
Definition: decl_multi_stream_handler.hpp:290
static std::shared_ptr< T > Open(const String &provider, AcquisitionStack acquisitionStack=AcquisitionStack::PreferVin)
Opens a device with the given provider with its default board and port (if applicable).
Definition: decl_device_factory.hpp:50
Controller object for the QML image view item.
Definition: image_view_item.hpp:254
void Refresh(const ImagePtr &image, AutoRefresh autoRefresh=AutoRefresh::Off)
Share the image and refresh the view.
Definition: image_view_item.hpp:296
static void Register()
Convenience method to register this type in QML.
Definition: image_view_item.hpp:670
void setResizeMode(QQuickView::ResizeMode)
QQmlContext * rootContext() const const
void setSource(const QUrl &url)
QUrl fromLocalFile(const QString &localFile)
void resize(const QSize &newSize)
void setIcon(const QIcon &icon)
UI definition using QML.
2import CvbQuick 1.0 as CvbQuick
13 uploadMode : CvbQuick.UploadMode.Image
20 + String(imageView.hoverPosition)
22 + String(imageView.hoverPixel)
24 + String(imageView.zoomFactor.toFixed(2))
25 anchors.horizontalCenter: parent.horizontalCenter