Windows 8: TopMost window

TopMost

I am working on my next ambitious project “MouseTouch” which is multi touch simulator application for windows 8 platform and intended to increase the productivity if you are running windows 8 on non-touch device.

This will bring the touch feature of windows 8 to life even if you are using mouse pad.

The first challenge is how to render something on top of metro start menu items?

So if you want to create a true topmost window which can float even on top of windows 8 metro apps here are the simple steps..

  1. Create WPF visual studio application (or any other window app )
  2. Set TopMost=True for MainWindow
  3. Right-click on your project in the Solution Explorer
  4. Select “Add New Item” from the context menu.
  5. Choose “Application Manifest File” from the list of options in the dialog box that appears.
  6. Right-click on your project in the Solution Explorer and click “Properties” (or double-click on the “Properties” item under your project).
  7. Under the first tab (“Application”),select your app.manifest file from the drop-down box labeled “Manifest”.
  8. Set the, <requestedExecutionLevel level=”asInvoker” uiAccess=”true” />

The next part is to create a certificate and install it in trusted root authorities.

  1. Create certificate 
    1. makecert -r -pe -ss PrivateCertStore-n “CN=TopMost.com” topmost.cer
  2. Import certificate to (Local Machine) trusted root certification authorities using mmc.exe.

Now sign your executable using the certificate, either by using the command, or using visual studio (check the delay sign flag).

  1. Signtool sign /v /s PrivateCertStore /n TopMost.com /t http://timestamp.verisign.com/scripts/timestamp.dll TopMost.exe

Now copy the TopMost.exe to trusted location like c:Windows or program files and execute the TopMost.exe..

Still struggling ..

Ok if , executable is not signed or certificate is not installed properly, you see following exception

referralError

 

 

 

 

 

 

 

To avoid this exception, open mmc.exe, add certificates snap-in>Select Computer account>Local Computer>

Go to trusted root certification authorities>certificates>right click > tasks and import the certificate ..

CertInstall

Microsoft Surface & Windows 8

Microsoft Surface

 Black, bevelled and beautifully designed, a tablet that’s a unique expression of entertainment and creativity. A tablet that works and plays the way you want. A new type of computing. Surface.

Windows 8

If you only want a quick look round at the Windows 8 highlights, then, the safest approach is to install it on a VirtualBox virtual machine. You won’t have to spend time freeing up a laptop or creating a new partition, and can browse the new Metro interface in a window on your desktop: far more convenient.

Installation

And finally here are few screen shots

Start building on Windows 8 > http://www.buildwindows.com/

Designing Ux for Apps : http://msdn.microsoft.com/en-us/library/windows/apps/hh779072

Windows 8 Animations : http://msdn.microsoft.com/en-us/library/windows/apps/hh975420

Coming soon > Tech. in-depth on windows 8_

Silverlight for Symbian S60 devices

Microsoft has released Silverlight platform design to work with Symbian S60 devices at the on MIX10 conference at Las Vegas.The plateform is now available for Nokia SymbianOS (S60 5th Edition) devices i.e. Nokia 5235, 5800 XpressMusic, Nokia N97 and Nokia N97 Mini Mobiles. I did some basic test with nokia 5235 and it runs with charm.

The current Silverlight beta for Symbian comes in two forms – one as an installer for Symbian (S60 5th edition) devices and the second one in the form of a developer tools suite for developing Silverlight applications for Symbian devices including emulator etc.

Silverlight includes a Runtime that is optimized to display content on memory-constrained devices.

  •  The ability to view Silverlight applications in the mobile browser.
  •  Tools to build Silverlight applications that target devices

Microsoft has bought the Silverlight platform to a non-Microsoft mobile platform for the first time ever.

In order to get started with Silverlight for Symbian, you will want to familiarize yourself with the platform capabilities.

More resources are available on microsoft website.

Days are not far when you will see silverlight on rest of consumer devices ..

3d Lenticular (3d Without Glasses)

After Anaglyph 3DPlayer from last month, the next challenge is to create 3d without glasses using lenticular sheet. A lenticular lens is an array of magnifying lenses, designed so that when viewed from slightly different angles, different images are magnified. The most common example is the lenses used in lenticular printing, where the technology is used to give an illusion of depth, or to make images that appear to change or move as the image is viewed from different angles.

Lenticular imaging is a multi-step process consisting of creating a lenticular image from at least two existing images, and combining it with a lenticular lens. This process can be used to create various frames of animation (for a motion effect), offsetting the various layers at different increments (for a 3d effect).

To create output from two input images here in this article you will find lenticular shadder effect (WPF).With lenticular effect you can transform image or video into lenticular source within WPF or online Silverlight application. The heart of lenticular effect is HLSL (High Level Shader Language) code

int pxW =floor (PixelWidth);
float virtualRow;
if(Direction ==0)
virtualRow =round( (uv.y * ImageHeight)/(floor (PixelWidth)));
else
virtualRow =round( (uv.x * ImageWidth)/(floor (PixelWidth)));

if (virtualRow % 2 >= 1) //Odd Even Rows
return tex2D(RightImage, uv);
else
return tex2D(input, uv);

The HLSL code above calculates the pixel position and determines from which source it has to pick the pixel color information to create final output. To create and test HLSL program I have used Shazzam pixel shader utility which is very nice tool to quickly develop shader logic.

The attached Silverlight project uses lenticular effect to render merged images and to convert it into good looking 3d, you need to precisely align lenticular sheet on top of your laptop.

Lenticular output from Silverlight project and final look, after you put your lenticular sheet

         .

xaml behind project is

<Image Margin="20" Stretch="None" Name="imageSource" Source="/LenticularEffect3D;component/Uta_bar_sm 1.png">
<Image.Effect>
<effects:LenticularEffect ImageWidth="{Binding ElementName=imageSource,Path=ActualWidth}" ImageHeight="{Binding ElementName=imageSource,Path=ActualHeight}" x:Name="lenticularEffect"  Direction="1" PixelWidth="1" >
<effects:LenticularEffect.RightImage>
<ImageBrush Opacity="1"  ImageSource="/LenticularEffect3D;component/Uta_bar_sm 2.png">
</ImageBrush>
</effects:LenticularEffect.RightImage>
</effects:LenticularEffect>
</Image.Effect>
</Image>

The lenticular sheet has specific ppi (pixel per inch) , since we are trying to produce 3d from laptop screen (TFT DPI 120) and you have to somehow match the picture pixels to screen & screen dpi to lenticular sheet to get desired results. I was not able to achieve very good 3d output as you will need matching ppi lenticular sheet and very high resolution screen to fix at least two pixes under single lenticular lense.

Download source code