Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blit() Performance dependent on screen rotation

Tags:

windows-ce

mfc

I am developing an application for a WinCE 6.0 device in which there is a need to rotate the screen, so we are using the typical ChangeDisplaySettingsEx() API. and also I am drawing something on the View.

While blitting from the memDC to the main DC, it is taking 20ms for 700x300 pixels in Landscape mode, but in Portrait mode blitting a 450x450 block is taking 50 ms.

I am not able to determine why this is happening. Here is the device configuration :- 800x480 resolution. I am using Normal Blt() API for that.

Any suggestion will be helpful

like image 624
John li Avatar asked Nov 05 '22 10:11

John li


1 Answers

I know nothing about WinCE, but the performance difference is logical if the copy algorithm works line by line.

In one mode the layout of the pixels on the screen an in video RAM are identical. If that is the case, a line on screen corresponds to a number of consecutive memory addresses.

In portrait mode the algorithm needs to access a new memory location for each new pixel. Although the pixels sit right next to each others, the memory addresses to not.

like image 71
Helge Klein Avatar answered Nov 11 '22 20:11

Helge Klein