Technology Questions

Go Back   Technology Questions > Hardware Questions > Mobile Computers > Tablet PC > Tablet PC Software > Tablet PC Developers

Tablet PC Developers Show off your work while discussing with others how to create ink enabled applications.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 06-05-2007, 02:20 PM
Alz
Newsgroup Contributor
 
Posts: n/a
Transparent Form, Solid InkOverlay?

Hi, I am trying to create a transparent form with solid InkOverlay in C#
using Visual Studio.

I placed an inkoverlay on top of the form so I can write stuff on it.
However, now I want to make the form transparent, but I also want the
controls and the ink drawn on the inkoverlay to be solid. Is there a way to
do this? I've tried to use opacity, but that just makes everything
transparent. I've tried a few other things such as attaching the overlay to
a panel, setting the transparencyKey, etc, but nothing works. Any help would
be appreciated =).

Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 06-05-2007, 02:20 PM
  #2 (permalink)  
Old 06-18-2007, 09:31 PM
Shawn A. Van Ness [MS]
Newsgroup Contributor
 
Posts: n/a
RE: Transparent Form, Solid InkOverlay?

WPF is the only framework that we ship, that makes this scenario "easy".

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
WindowStyle="None"
AllowsTransparency="True"
Background="#789A">
<InkCanvas Background="Transparent" Opacity="1.0">
<InkCanvas.DefaultDrawingAttributes>
<DrawingAttributes Width="7" Height="7" Color="Purple" />
</InkCanvas.DefaultDrawingAttributes>
</InkCanvas>
</Window>

I say "easy" in quotes because you'll have to take responsibility to draw
all your own chrome (titlebar, close button etc).

But still it's much easier than dealing with UpdateLayeredWindow() in Win32.
http://msdn2.microsoft.com/en-us/library/ms633556.aspx

AFAIK winforms doesn't offer any help for doing per-pixel alpha compositing
with UpdateLayeredWindow. As you've discovered, it only offers whole-window
opacity ala SetLayeredWindowAttributes.

WPF may or may not work for you. It's great if everything you're doing is
available natively within WPF. It's not so great if you're say, trying to
collect ink over IE or some other hosted Win32 or WinForms content or
controls.

Still, even for that kind of scenario, I've seen some people go the route
where they create a new top-level window with WPF (borderless, chromeless,
AllowsTransparency=True) to do the ink collection. They just keep its size
and position in sync with the underlying Win32/Winforms app window... messy,
but it works. :-)

HTH,
-S


"Alz" wrote:

> Hi, I am trying to create a transparent form with solid InkOverlay in C#
> using Visual Studio.
>
> I placed an inkoverlay on top of the form so I can write stuff on it.
> However, now I want to make the form transparent, but I also want the
> controls and the ink drawn on the inkoverlay to be solid. Is there a way to
> do this? I've tried to use opacity, but that just makes everything
> transparent. I've tried a few other things such as attaching the overlay to
> a panel, setting the transparencyKey, etc, but nothing works. Any help would
> be appreciated =).
>
> Thanks!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Ink over Transparent Form CJ Tablet PC Developers 0 11-28-2008 09:16 PM
Access 2007 Transparent Form scott w t Windows Vista 0 05-16-2008 07:10 AM
InkOverlay and Word Matt Ray Tablet PC Developers 3 07-25-2007 03:20 PM
Re: InkOverlay Kendal Goodrich Tablet PC Developers 1 05-06-2007 07:31 AM
InkOverlay Handle Leak? JasonG Windows XP Tablet PC Newsgroup 3 02-22-2005 08:16 AM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 11:06 AM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0