Thursday, April 19th 2018, 7:24pm UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

mastupristi

Beginner

Date of registration: Feb 18th 2016

Posts: 38

1

Monday, April 9th 2018, 3:31pm

dimension of backround window

I tried to get the size of the background window:

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
	GUI_Init();
	GUI_EnableAlpha(1);
	GUI_UC_SetEncodeUTF8();
	GUI_SetBkColor(GUI_BLACK);
	GUI_Clear();
	WM_SetCallback(WM_HBKWIN, _cbBkWin);

	WM_SetCreateFlags(WM_CF_MEMDEV);
	WM_EnableMemdev(WM_HBKWIN);

	int xSize, ySize;
	GUI_RECT	Rect;

	xSize = WM_GetWindowSizeX(WM_HBKWIN);
	ySize = WM_GetWindowSizeY(WM_HBKWIN);

	WM_GetInsideRectEx(WM_HBKWIN, &Rect);

and size il 16383 for both x and y, whether I use the WM_GetWindowSize*() or WM_GetInsideRectEx() functions.
Why?
I expected the size of the background window to be the same as the size of the LCD.
Am I making a mistake?

best regards
Max

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 561

2

Thursday, April 12th 2018, 10:18am

Hi,

No, this not a mistake from your side.

The desktop window gets created with a size of 16383 pixels in each direction as default.

Just call add the code below right after GUI_Init() to get a desktop window with the size of the screen.

C/C++ Source code

1
WM_SetSize(WM_HBKWIN, LCD_GetXSize(), LCD_GetYSize());


The reason behind this is that if using virtual screens it has to be large enough, that is why we decided to make it that large.

So if you are using virtual screens be careful when reducing the size.

Regards
Sven

Similar threads