Use gravity to generate Cartoon animation frames

I wrote a cartoon animation program around 1982 in C. The Honolulu Academy of Arts asked me to demo the program in their Focus on Computer Graphics. The program allows the user to draw lines of a cartoon frame using the mouse. The user then saves that frame and draws another. To animate, the program…

1

DPI Aware Sample

Last time I showed a way to use immediate mode graphics in WPF by showing balls bouncing around in a window. This time, we’ll add a few features. I’ve made the program DPI (Dots Per Inch) Aware. On most machines it works correctly. However, on my brand new Surface Pro 3 (really nice!), the screen…

0

WPF immediate mode graphics

Windows Presentation Foundation (WPF) is a retained mode graphics system (see Retained Mode Versus Immediate Mode). That means when you write code to draw something, you’re actually declaring a set of graphics objects (like lines or shapes) to use. The graphics library then creates a model in memory. This model changes in response to your…

1

Scan the Windows Event Log for your application crashes and hangs

When you write software that runs on someone’s machine, it might crash or hang. If this occurs, there are ways to see if this occurred from your program. For example, I wrote a simple application in C++ called CppTest that crashes by dereferencing a null: char *ptr = 0; *ptr = 0; Lo and behold:…

0

Cartoon animation works great on Surface Pro

I showed my 9 year old son a cool drawing program called Physamajig, in which users can draw objects, which behave like real physical objects, including reacting to gravity, friction, and bounce. He was having fun with it on my Surface RT and it reminded me of another program. Years ago (around 1981) when I…

1

Its easy to Create your own FrameWorkElement in WPF

Sometimes you want to have very fine control of how your application looks and behaves. Other times, you just want to draw something on your UI. It’s pretty easy to create your own control class and put instances of it on your form. The sample below create a new class MyFrameworkElement which allows you to…

0

Examine your program’s available memory: is it leaking?

  Sometimes your program wakes up and finds itself running in an environment that might not be as suitable as you’d like.   For example, it might be distributed to a user running on a machine with not enough memory, and could be failing. Perhaps the failures occur because the user is running multiple applications…

0

Process Windows Messages in your WPF application

  I have some code that attaches and injects code into a target application (like Visual Studio or IE) to examine its memory use. In order to do that, my code freezes the target.   I wanted my application to respond to WM_QUERYENDSESSION so that when the user is shutting down, it unfreezes the target,…

0

Advanced debugging: change your program execution without Edit and Continue

Last time (Improve your managed debugging skills: examining registers and memory) we examined some debugging techniques to understand the behavior of managed code.   It might take a long time or many manual steps to reproduce a particular software behavior in an application. Changing the instructions that are executed by the target program while it’s…

1

Improve your managed debugging skills: examining registers and memory

  I was helping a colleague and we were deep in the middle of a debug session, single stepping some code and we wanted to see a value in the debugger. The debugger showed either nothing, because the intermediate value has been optimized out, or a message like “cannot display value, possibly because it has…

1