September 2007 - Posts

BarCamp Orlando

Here is the powerpoint (http://www.onetug.org/DNN/Portals/0/member_files/2007_09_23_BarCamp.ppt) for the presentation that I plan on doing Sunday at BarCamp Orlando. See you there!
In the presenation I will provide an overview of MS Robotics Studio, and then provide 4 demo’s.
Demo #1: iRobot Drive by wire
Demo #2: Physics Simulation
Demo #3: Can you find me?
Demo #4: Robot Sumo!
All the demo’s are avaiable to download along with the MS Robotics Studio from the Microsoft Website http://www.microsoft.com/robotics

Posted by sweisfeld | with no comments

Tallahasse Code Camp


Although it was a bit of a drive, Tallahassee Code Camp was great. I have included both presenations and the sample code in the attached zip file.
http://www.onetug.org/DNN/Portals/0/member_files/2007_09_22_TalCodeCamp.zip

Posted by sweisfeld | with no comments
Filed under: , ,

Office 2007 Ultimate for Students only $60

Hey if you are a student and have not upgraded then now is your chance. One of my students found this website and I thought I would share. Go to http://www.theultimatesteal.com/product.asp and you can get Office 2007 Ultimate for only $60. The catch is that it is a download (you can get a CD for extra) and you must register with a .edu email address. Check it out!

BTW: if you are hesitant about upgrading you can also get a plugin for older office to read the new file formats. http://www.microsoft.com/downloads/details.aspx?familyid=941b3470-3ae9-4aee-8f43-c6bb74cd1466&displaylang=en

Posted by sweisfeld | with no comments
Filed under: ,

Image Processing v2.1

BTW to convert from the byte[] back to an image is simple enough

private Bitmap ConvertBitmap(byte[] frame, int width, int height)
{
    Bitmap bmp = new Bitmap(
 width,
 height,
 PixelFormat.Format24bppRgb);

    BitmapData data = bmp.LockBits(
 new Rectangle(0, 0, bmp.Width, bmp.Height),
 ImageLockMode.WriteOnly,
 PixelFormat.Format24bppRgb);

    System.Runtime.InteropServices.Marshal.Copy(frame, 0, data.Scan0, frame.Length);

    bmp.UnlockBits(data);
    return bmp;
}

Posted by sweisfeld | 2 comment(s)
Filed under: , , ,

Image Processing v2

I was tearing into v1.5 of Microsoft Robotics Studio (http://www.microsoft.com/robotics) and came across a novel way to process the pixels in an image. In previous posts I was using unmanaged C# code and pointers to move around the image. This worked well but is hard to manage. They take the approach of just dumping the entire image to a byte[], pure genius, now why did I not think of that. I will be rebuilding my library to utilize this technique but I thought this was so cool that I just had to share it!

/// <summary>
/// Coverts a bitmap to a byte[] then prints out the contents to a file
/// </summary>
public void PrintImage()
{
    string file = "image.bmp";
    Bitmap bitmap = Bitmap.FromFile(file) as Bitmap;
    byte[] frame = ConvertBitmap(bitmap);
    int height = bitmap.Height;
    int width = bitmap.Width;

    using (StreamWriter sWriter = new StreamWriter(file + ".txt"))
    {
        int offset;

        //header
        sWriter.WriteLine(string.Format("({0}, {1}) {2},{3},{4}", "COL", "ROW", "RED", "GREEN", "BLUE"));

        //loop over rows
        for (int y = 0; y < height; y++)
        {
            offset = y * width * 3;

            //loop ober columns
            for (int x = 0; x < width; x++, offset += 3)
            {
                int r, g, b;

                b = frame[offset];
                g = frame[offset + 1];
                r = frame[offset + 2];

                //pixel information
                sWriter.WriteLine(string.Format("({0}, {1}) {2},{3},{4}", x, y, r, g, b));
            }
        }
    }
}

/// <summary>
/// Convert a bitmap to a byte array
/// </summary>
/// <param name="bitmap">image to convert</param>
/// <returns>image as bytes</returns>
private byte[] ConvertBitmap(Bitmap bitmap)
{
    //Code excerpted from Microsoft Robotics Studio v1.5
    BitmapData raw = null;  //used to get attributes of the image
    byte[] rawImage = null; //the image as a byte[]

    try
    {
        //Freeze the image in memory
        raw = bitmap.LockBits(
            new Rectangle(0, 0, (int)bitmap.Width, (int)bitmap.Height),
            ImageLockMode.ReadOnly,
            PixelFormat.Format24bppRgb
        );

        int size = raw.Height * raw.Stride;
        rawImage = new byte[size];

        //Copy the image into the byte[]
        System.Runtime.InteropServices.Marshal.Copy(raw.Scan0, rawImage, 0, size);
    }
    finally
    {
        if (raw != null)
        {
            //Unfreeze the memory for the image
            bitmap.UnlockBits(raw);
        }
    }
    return rawImage;
}

Posted by sweisfeld | with no comments
Filed under: , , ,

Silverlight Halo 3 Video!

In post in Joe Healy's blog (http://www.devfish.net/FullBlogItemView.aspx?BlogId=441) he said “Pick which you think is cooler, the Silverlight playback or Halo3 trailer itself”. I need an option C. I did not have Silverlight installed. So when I went to the page it told me to download it, and within 30 seconds Silverlight was installed and I was watching the movie. So I vote for the easy installation as the coolest. But the video was awesome also!

 

Posted by sweisfeld | with no comments
Filed under:

Fiddler Web Debugging Proxy

Went to an MSDN event by Russ (http://blogs.msdn.com/rfustino/) a few weeks ago and during his demo he displayed this cool tool called Fiddler (http://www.fiddler2.com/).  A must have debugging tool for any Smart Client or Web Developer.

Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

Fiddler is freeware and can debug traffic from virtually any application, including Internet Explorer, Mozilla Firefox, Opera, and thousands more.

Posted by sweisfeld | with no comments
Filed under: , , , , , ,