Drawing is slower in Landscape mode


I found a strange drawing on Windows Mobile. If you draw a Bitmap it takes:
- 3 ms in Portrait mode and
- 65 ms in Landscape mode.
(Tested on VGA emulator)

Method:
e.Graphics.DrawImage(m_Bmp, 0, 0);

It seems the Landscape drawing is emulated only, and the bitmap rotation takes so many time.

It can make problems when you want to animate, or e.g. when you have double buffering and you need repaint some areas on mouse move event.

If you know a faster way of drawing Bitmap, feel free to comment this post.

You can try out my sample here:
http://winmobile.euweb.cz/#Post11

Update:
On QVGA device:
- Portrait: 2 ms (average)
- Landscape: 6 ms (average)
On VGA device:
- Portrait: 6 ms (average)
- Landscape: 47 ms (average)

Speed Up Your Windows Mobile Builds

I found this useful trick on Nick Randolph's blog:

"One of the things that continually frustrates me about building Windows Mobile applications in Visual Studio is that for some reason it takes so long to do a build. Behind the scenes there is a lot that goes on and I always forget that there is one part of the build that you can mostly do without, the platform verification. As pointed out by the now quite old post by the Visual Studio for Devices team you can disable this part of the build quite easily:

1) Open the file %windir%\Microsoft.NET\Framework\v2.0.50727\Microsoft.CompactFramework.Common.Targets for editing.

2) Go to the line which reads:
Name="PlatformVerificationTask">
and change it to:
Name="PlatformVerificationTask" Condition="'$(SkipPlatformVerification)' != 'true'">

3) Add the SkipPlatformVerification environment variable to the system and set it to "true" (To re-enable Platform Verification set the environment variable to "false")

4) Restart Visual Studio for the changes to take effect (If building from the command line using MSBuild, add /p:SkipPlatformVerification=true to your command line to turn off the task. You can specify the variable in the project file also, so that this information is persisted across sessions).

As noted by Thomas you may just want to disable this functionality, instead of having it contingent on an environment variable. In this case just change the PlatformVerificationTask line to:

Name="PlatformVerificationTask" Condition="false">

Doing this you should notice that your mobile projects build just as fast as other projects within Visual Studio. Note: This is still relevant in Visual Studio 2008 with SP1."

I tried it out, and it really decreased the time for building my projects.

Source:
http://community.softteq.com/blogs/nick/archive/2009/07/22/speed-up-your-windows-mobile-builds.aspx

Freeware obfuscator for .NET CF and .NET



Eazfuscator.NET
is a free obfuscator for both .Net Framework and .Net Compact Framework with a simple and nice GUI.

The main purpose of obfuscator is to protect intellectual property of the software.

If you have a good experience with another obfuscator for windows mobile applications, feel free to comment this post.

Windows Mobile 6.5 Developer Tool Kit


The Windows Mobile 6.5 Developer Tool Kit is available for download. It includes the Emulator images as well as the documentation and the samples on Gesture APIs.

Converting a VS2008 csproj to VS2005

I discovered a few easy steps that can allow you to do this. Note: I had already converted (most) of the project files to use .NET 2.0. If you are using Ajax extensions you will have to make your web.config align with this as well. Do this first in VS2008. Obviously if you are using any .NET 3.0 or .NET 3.5 features, this isn't going to work for you...

Next open the csproj file you want to change in Notepad.

Near the top is the Project node. If this contains ToolsVersion="3.5" remove this attribute:

<Project ToolsVersion="3.5" DefaultTargets=...

becomes

<Project DefaultTargets=...

A few lines down there is a <ProductVersion> node, change the value:

<ProductVersion> 9.0.21022 </ ProductVersion>

becomes

<ProductVersion >8.0.50727 </ ProductVersion>

Near the bottom of the file, look for the

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

becomes

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

If there is another <Import node with an MSBuildExtensionsPath, delete this entire line.

Save the file and you should then be able to to open the file in VS2005. Don't double click on the file if you have both versions of Visual Studio installed, you will likely get the default VS2008 to load it.

G-Sensor, Light sensor

The Windows Mobile Unified Sensor API allows developers to easily access the hardware sensors that are available on various phones.

http://sensorapi.codeplex.com/

Call Firewall + SMS Blocker (FREE)

I found a free application to block your unwanted incoming calls:
http://www.logic-unlimited.in/callfirewall.php

Features:
a. Accecpt all calls
b. Accept call from My Contacts only.
c. Reject all calls
d. White List - accepts calls only from the white listed.
e. Black List - accepts all calls except from the black listed.
f. There is also an option to reply with an SMS.

Presentation Zoom Tool

Microsoft has a great Zoom tool specifically for presentations. It would be very useful for technical presentations where the code is hard to see on the projector.

PInvoke.Net

PInvoke.net is allowing developers to find PInvoke signatures, and any other information related to calling unmanaged APIs from managed code (written in C# or VB.NET).
E.g.:
[DllImport("coredll", EntryPoint="GetDC", SetLastError=true)]
private static extern IntPtr GetDCCE(IntPtr hWnd);



http://www.pinvoke.net/

They have an Add-in to Visual Studio 2003 and 2005, to make the insertion of PInvoke signatures an easy and fast operation.

You can download it from their page. It's FREE :)

Best regards,
Gabriel Minárik

I love this Add-in (SlickEdit Gadgets)

I think SlickEdit's ruler is very nice tool in Visual Studio.
The ruler indicates where your cursor is, and you haven't looking for it. 8)

Here is a screenshot from my IDE:


Of course it is FREE Add-in :) Thanks for the developers! ;)

Download page:
http://www.slickedit.com/content/view/441