Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - PtOsContainer moving image: (7 Items)
   
PtOsContainer moving image  
Hi:

I'm writing a demo for a potential customer, I need to be able to have a flicker free indicator move across a graphic 
background. This indicator is has been read in using PxLoadImage and has transparent areas. 

Ive tried using the PtOsContainer. Its smooth and flicker free - however it has a coloured background and I am unable to
 make it 1) transparent or 2) make its 'fill' the same as the real background. 
Q: is there something that I am missing with PtOSContainer? 

I am also looking into Video memory offscreen. This has potential. However it draws over the background and I get old 
draws still visible as the indicator moves. 
Q: Do I need to 'mask' out the previous indicator before blitting the updated one? If so how? Can you point me to sample
 code where the blitted image is moving? 

Thanks,
Andy
RE: PtOsContainer moving image  
please post your sample code, what OS version are you using?

-----Original Message-----
From: Andy Rhind [mailto:community-noreply@qnx.com] 
Sent: January 20, 2011 7:29 PM
To: photon-graphics
Subject: PtOsContainer moving image

Hi:

I'm writing a demo for a potential customer, I need to be able to have a
flicker free indicator move across a graphic background. This indicator
is has been read in using PxLoadImage and has transparent areas. 

Ive tried using the PtOsContainer. Its smooth and flicker free - however
it has a coloured background and I am unable to make it 1) transparent
or 2) make its 'fill' the same as the real background. 
Q: is there something that I am missing with PtOSContainer? 

I am also looking into Video memory offscreen. This has potential.
However it draws over the background and I get old draws still visible
as the indicator moves. 
Q: Do I need to 'mask' out the previous indicator before blitting the
updated one? If so how? Can you point me to sample code where the
blitted image is moving? 

Thanks,
Andy



_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post82520
Re: RE: PtOsContainer moving image  
Derek:

Sorry about that - I knew exactly what version of the OS I was using :) Its QNX6.5 

Ive put together a simple example that shows the PtOsContainer wont accept a transparent background.  Its attached.  
This is the simplest and the preferred solution, it would be perfect if you can get transparent working. 

I am putting a stand along demo together for the Video offscreen drawing. 

Thanks,
Andy

Attachment: Text OsContainerDemo.tgz 95.49 KB
Re: RE: PtOsContainer moving image  
PtOSContainer doesn't accepts transparent background -- just like the PtWindow.
I recommend placing your PtOSContainer as the first child of the PtWindow and making the OSContainer as big as the 
window -- use anchors if you need too resize both in sync. Then place all of your widgets into the OSContainer.
RE: RE: PtOsContainer moving image  
Hi Andy,

Ok, it will never have transparent background, unless we misunderstood
here, we thought you were trying with a solid colour background or a
transparent background.

The reason is that the PtOSContainer uses offscreen memory to composite
the display, before flipping it to the screen, and thus since it is
already pre-composited, it cannot take into account the content behind
it (*).

Now, you can place the entire contents of the window in a PtOSContainer
(move up the hierarchy).

I am guess what you want is something similar to this:

	Window -> pane (solid colour bkgd) -> buttons etc, draw stuff ->
then a PtOSContainer over top with transparent background

well, we would suggest this:

	Window -> PtOSContainer (solid colour bkgd) -> buttons, etc draw
stuff -> another transparent pane with content with content


-Derek

(*) Now with surface memory, it is always possible to do alpha blending,
etc., but that approach is beyond the reach of the PtOSContainer, and on
systems w/o hardware accelerated alpha blend, it is quite slow.

-----Original Message-----
From: Andy Rhind [mailto:community-noreply@qnx.com] 
Sent: January 24, 2011 12:59 AM
To: photon-graphics
Subject: Re: RE: PtOsContainer moving image

Derek:

Sorry about that - I knew exactly what version of the OS I was using :)
Its QNX6.5 

Ive put together a simple example that shows the PtOsContainer wont
accept a transparent background.  Its attached.  This is the simplest
and the preferred solution, it would be perfect if you can get
transparent working. 

I am putting a stand along demo together for the Video offscreen
drawing. 

Thanks,
Andy





_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post82560
Re: RE: RE: PtOsContainer moving image  
Thank you Derek & Misha: 

Thats the solution! 
I was using the PtOSContainer for just the widgets that were changing. Your solution is perfect, put the background then
 the animated label and anything else in the PtOsContainer.  

Andy
RE: RE: RE: PtOsContainer moving image  
You're welcome, glad it worked!

-----Original Message-----
From: Andy Rhind [mailto:community-noreply@qnx.com] 
Sent: January 25, 2011 12:22 AM
To: photon-graphics
Subject: Re: RE: RE: PtOsContainer moving image

Thank you Derek & Misha: 

Thats the solution! 
I was using the PtOSContainer for just the widgets that were changing.
Your solution is perfect, put the background then the animated label and
anything else in the PtOsContainer.  

Andy



_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post82604