emWin: non-rectangular area and MEMORY_DEVICE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

emWin: non-rectangular area and MEMORY_DEVICE

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by harper23 on Tue Jul 02 09:25:56 MST 2013

The emWin documentation states for the function GUI_MEMDEV_Create_Fixed that the parameter GUI_MEMDEV_NOTRANS allows using the memory device for non-rectangular areas. But there is no description how this non-rectangular area will be specified.


I want to use a memory device for the upper left triangle of my screen fill it with a picture. Finally this triangle should be copied to the LCD screen. Obviously a triangle is non-rectangular. What is the best approach for this?

Labels (1)
0 Kudos
2 Replies

543 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by harper23 on Thu Jul 04 10:52:28 MST 2013

Unfortunately the task is more complex than I described first in my example. To illustrate it better I attach a file. I have a background with two grafic areas (red and green) that change independently. Each of these two areas will be filled with PNG pictures including the appropriate alpha values. I want to update both pictures indepently. The updates occur often so that the normal GUI_PNG_Draw takes too much time. I though a memory device could help.


The memory device should help since the pictures don't overlap. But the rectangles surrounding the pictures (bounding boxes) overlap. This is the problem I could not solve even with memory device. Any suggestion?


The real application is a bit more complex. The green areas bounding box intersects with an addtional other area for PNG pictures. Any kind of a merge of memory devices (and LCD device) controlled by pixelwise alpha value should be available to fullfill the task. But it looks like that emWin lacks this feature.

0 Kudos

543 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Wouter on Wed Jul 03 01:02:26 MST 2013

Hi,


 


The memory device itself is always rectangular, as it's defined by X0, Y0, Xsize and Ysize. I also don't really see how a memory device with no transparancy could help in displaying non-rectangular areas. In fact, I would use the transparancy feature for displaying a non-rectangular area since then you don't need to worry about the background...


In your case, you could simply define the memory device with a size fitting the triangle with transparancy enabled, draw the image to the memory device and copy it to the LCD. In fact, if it's only one drawing operation, you can probably leave out the memory device and draw your image directly to the LCD. Just make sure your triangle-shaped image has all pixels outside the triangle set to transparant.


 


Regards,


Wouter

0 Kudos