Vibratium 1.3

The Vibratium 1.3 update is now available.

Rotate2_Red

This is includes numerous changes, the most noticeable of which is the object list/editor on the left and the introduction of the RotatePoint.

1. The object list now uses one editor control for all objects. You can manually click the objects in the list or use Page Up, Page Down, Home, and End to navigate.
2. I’ve added the new Rotate Point type. This uses two points. The first point is the center of the area where the rotation will be displayed and the second point defines the center point of the source of the rotated image. By default these are the same unless you select the (X2,Y2) button to separate them. (The radius is currently fixed at 128 pixels.)
3. The source point will be displayed as a reticle without the circle around it.
4. Use the dropdown box to choose which type you want to add to the list.
5. The majority of the changes are refactoring/rearchitecting the render engine code and making it more extensible for future object types as this moves away from being a research project.

I spent a fair amount of work this release in moving to an MVC pattern with the UI in the hopes of making this a Win10 app to put in the store soon. Due to the buffer caching for performance reasons it’s still a memory hog.

I have a lot of ideas for new object types and effects but let me know if there are any in particular you’d like to see.

More info and download instructions here –
https://www.georgepotts.com/apps/vibratium/

Vibratium 1.1 Update

Vibratium 1.1 update is now available.

This is a minor update that adds crosshairs to locate the centers of the render objects and eliminates a couple of extra files.  More info and download instructions here –

https://www.georgepotts.com/apps/vibratium/

Handling IDisposable Objects in a Generic List

I wanted to have more precise control over the lifetime of objects I was keeping in a list rather than wait for the GC. I came up with the code below which adds a few extension methods for handling IDisposable objects in a generic list. This was more elegant than adding a helper class.

I only implemented what I needed for the current project but these are very straightforward to do.

Sample code below.

using System;
using System.Collections.Generic;

namespace MyExtensions
{
    public static class Extensions
    {
        /// Remove tail, starting at index.
        public static void RemoveTail<T>(this List<T> list, int index)
        {
            if (index >= list.Count) { return; }

            if (typeof(IDisposable).IsAssignableFrom(typeof(T)))
            {
                List<T> temp = list.GetRange(index, list.Count - index);
                ClearAndDispose(temp);
            }
            list.RemoveRange(index, list.Count - index);
        }
        public static void ClearAndDispose<T>(this List<T> list)
        {
            if (typeof(IDisposable).IsAssignableFrom(typeof(T)))
            {
                foreach (T obj in list)
                {
                    IDisposable iFace = (IDisposable)obj;
                    iFace.Dispose();
                }
            }
            list.Clear();
        }
    } //*** Extensions
} //*** namespace

Usage is simple.

using MyExtensions;
...

var myList = new List<HugeObject>();
...

myList.RemoveTail(idx);
...

myList.ClearAndDispose();

Escher Version 0.2

Escher Version 0.2 is up.

This version fixes the flicker issue, adds undo, fill/no-fill enclosed shapes, and drawing crosshairs.

Escher is a free, fun multi-shape drawing program for doodling, like a cross between MSPaint and a kaleidoscope.

More details here:  https://www.georgepotts.com/apps/escher/

Example:
FlyingTriangles

SSELibrary 0.2 Available

SSELibrary 0.2 available for download. This version includes a much larger library of functions (149) with nearly full coverage of 8-bit operations, as well as enhanced CPU feature detection.

Details here: https://www.georgepotts.com/apps/sse-library/

Vibratium 1.0.2 Update

Vibratium Version 1.0.2 is now available. I fixed a few bugs and added a new Diff combine option.

https://www.georgepotts.com/apps/vibratium/

Introducing Vibratium

Vibratium

Download Vibratium 1.0.1
Download Vibratium 1.3
(More info here https://www.georgepotts.com/apps/vibratium/)

Vibratium allows you to generate unique animations that would be impossible to do manually.  This is done by combining the output of “render points,” which are wave-based animations, each centered at a single point.

Click the images above to view the 800×800 versions in new tabs.  I especially like the red one as I somehow generated a triangle fractal pattern. (Note that it links to the bmp version which is ~2.4MB.)

Vibratium_Image_TwoBluesXOR_160x160Vibratium_Image_FourMixed_EQ_Fractals_160x160

Vibratium_Image_FourBluesMixed_160x160Vibratium_Image_TwoMultis_Mixed_160x160
Videos here – YouTube Vibratium Playlist
Here’s the project file for the first video – BlackAndBlueWaves.zip

Continue reading

WinForm Label Not Getting Focus

I have a user control that contains a few other controls, including Labels.  When any of the controls gets focus I want the parent to get notified.  I added an Enter event handler to the parent.  (Note: with Forms the equivalent to Enter/Leave is Activate/Deactivate.)  This almost works – any time I click on anything *except* the Labels the parent control gets focus.  After a bit of research I realized my error – Labels cannot receive focus, therefore the Enter event never fires despite it being there due to deriving from the Control class. (Enter and Leave events travel up the tree so all parents controls get notified.)

Stepping back, what I really want is that when I click anywhere on the control an Enter event is fired.

Continue reading