GIS內核-Display的初始化

    GsPaintDevicePtr pDevice;
    //如果操作系統平臺是windows則使用windows direct2d引擎
    bool bUseD2D = QString::compare(QGuiApplication::platformName(),"windows",Qt::CaseInsensitive) ==0;

   
    if(bUseD2D)
        pDevice = GsPaintDevice::CreatePaintDevice(eWin32HwndDeviceD2D,(void*)this->winId()).p;
    else
        pDevice = GsPaintDevice::CreatePaintDevice(eQTBackingStore,&m_backingStore).p; 

    GsRect deviceExtent(0,0,this->width(),this->height());
    GsDisplayTransformation* pDT = new
            GsDisplayTransformation(
                GsBox(deviceExtent.Left, deviceExtent.Top,
                      deviceExtent.Right+1, deviceExtent.Bottom + 1),deviceExtent);

    GsScreenDisplay* pDisplay = new
            GsScreenDisplay(pDevice,pDT);

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章