Re: HPEN and Rectangle() on Contantly refeshing window object

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



See below...
On Mon, 23 Jul 2007 09:20:00 -0700, RobKinney1
<mydigitalportal.net@xxxxxxxxxxxxxxxxxxxxxx> wrote:

Hello Joe,

Thank you for your response! I am just now getting back to this part of the
project as I had to take a small detour late last week.

Indeed I cannot get to the video rendering at this time (although in the
future we will be when implement a lot of this DirectShow stuff ourselves).

However, this idea about creating a transparent window (as opposed to the
transparent dialog which we have made now existing as a titlebarless (is that
a word?) window in the resource window) intrigues me.
****
Any transparent window would work, and a transparent dialog gives you the ability to
easily drag it (just return HTCAPTION if the superclass gives you HTCLIENT for the hit
position), and the ability to drag edges is built in, so it would not be an unreasonable
form of transparent window to choose.
****
This may be a stupid
question, but how do you begin something like that? I would assume that you
would say (and this is pseudo code) Window myTransparentWindow = new
Window(); ... and then be able to set coordinates, sizes, and finally apply
the transparent effect. What is the object I am looking for? Just a slight
push in the right direction should have me rolling again.
****
If you choose to create a separate window, if you don't choose to use a transparent dialog
(as suggested above), then you would start with a CWnd. You might declare a class
CMyHighlightingWIndow, and declare
CMyHighlightingWindow c_Highlight;
note that there is no need to do a 'new' at all! You could do a create
c_Highlight.CreateEx(...);
where you would specify the WS_EX_TRANSPARENT extended style. Alternatively, you could
set the transparency mode using ::SetLayeredWindowAttributes with the LWA_ALPHA flag and a
transparency value. This would give you either a completely transparent window (with a
transparency of 255) or some nice degree of transparency that would highlight the area.
joe
****

Thanks again for your input! It is greatly appreciated! :~]

Rob
---

"Joseph M. Newcomer" wrote:

This is what should happen, so it should not be surprising. It has nothing to do with an
HPEN, or Z-order, or anything else. It has to do with the fact that you draw something on
the window, anything drawn later will overwrite it, so it gets overwritten by the next
video frame.

To make this work, you would need to have a handler in the OnPaint that does the video
drawing and cause it to redraw your rectangle (you would have to make a record of the
coordinates for the OnPaint, which is what you would normally do).

But if you can't get at the video rendering, the next approach would be to create a
transparent window on top of the video window, and render in it the image of the
rectangle. The rest of the window will be transparent.
joe

On Tue, 17 Jul 2007 15:50:01 -0700, RobKinney1
<mydigitalportal.net@xxxxxxxxxxxxxxxxxxxxxx> wrote:

Hello,

Well, I am totally stumped on this one.

VC++ 6.0:

I have an app that has a video window playing. What I need to do is to be
able to draw a rubberbanded rectangle around an area within this screen.
Well, the rubberband stuff works until it stretches over the video part of
the window -- you will see the rubberbanded Rectangle for a split second on
every mouse move, but as soon as motion stops, the rubberbanded rectangle
line will be overwritten with the animated video screen.

Is there a trick to set an HPEN object to be the top Z order so that it
doesn't disappear when over another part of the window that is constantly
refreshing?

Sorry, but I am having a hard time explaining it.

Thank you all... hope someone can help us out.

Rob
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Directshow, rendering on transparent form
    ... > transparent, the video does not update. ... I do have an OnPaint function, but I don't know how to get ... > the handle of the window which displays the video, so I don't think I can use ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: HPEN and Rectangle() on Contantly refeshing window object
    ... the window, anything drawn later will overwrite it, so it gets overwritten by the next ... you would need to have a handler in the OnPaint that does the video ... able to draw a rubberbanded rectangle around an area within this screen. ...
    (microsoft.public.vc.mfc)
  • Re: HPEN and Rectangle() on Contantly refeshing window object
    ... I have an app that has a video window playing. ... able to draw a rubberbanded rectangle around an area within this screen. ... your rubber band on the bitmap you grabbed. ...
    (microsoft.public.vc.mfc)
  • Re: HPEN and Rectangle() on Contantly refeshing window object
    ... Indeed I cannot get to the video rendering at this time (although in the ... this idea about creating a transparent window (as opposed to the ... able to draw a rubberbanded rectangle around an area within this screen. ...
    (microsoft.public.vc.mfc)
  • Problem with Shaped Windows Forms
    ... Visual Studio has a doc that explains how to create a shaped window. ... I followed the doc exactly yet the purple color that I choose as my ... background of my form will not show as transparent. ... This property sets the bitmap image to be the background of the form. ...
    (microsoft.public.dotnet.faqs)