06-27-2012 05:53 PM
How do you get the display width and height?
ie in java Display.getWidth()
Solved! Go to Solution.
06-28-2012 09:12 PM
For anyone needing to do this here's how I did it
screen_context_t m_screen_cxt; int count = 0, size[2]; screen_display_t *displays; screen_create_context(&m_screen_cxt, SCREEN_APPLICATION_CONTEXT); screen_get_context_property_iv(m_screen_cxt, SCREEN_PROPERTY_DISPLAY_COUNT, &count); displays = (screen_display_t*)calloc(count, sizeof(screen_display_t)); screen_get_context_property_pv(m_screen_cxt, SCREEN_PROPERTY_DISPLAYS, (void **)displays); screen_get_display_property_iv(displays[0], SCREEN_PROPERTY_SIZE, size); free(displays);
size[0] contains screen width, size[1] contains screen height
07-10-2012 03:33 PM - edited 07-10-2012 03:34 PM
Try:
bb::device:: DisplayManager displayManager;
bb::device:: Display& display = displayManager.getDisplay(displayManager.primaryDi
QSize size = display.pixelSize();
Stuart
08-30-2012 04:24 PM
08-30-2012 04:35 PM - edited 08-30-2012 04:37 PM
If I use:
bb::device::Display display;
then I get:
C:\BB_DEV\Native\Workspaces\BB10_WS\myTazks\arm/../src/app.cpp:6: undefined reference to `bb::device::Display::Display(QObject*)' C:\BB_DEV\Native\Workspaces\BB10_WS\myTazks\arm/.. /src/app.cpp:25: undefined reference to `bb::device::Display::~Display()'
08-30-2012 05:59 PM
12-21-2012 09:45 AM
DisplayInfo display;
m_nScreenWidth = display.pixelSize().width();
m_nScreenHeight = display.pixelSize().height();