The Reddest

The Reddest


  • Name: Brandon Cannaday
  • Favorite Languages: C#, Javascript, C++
  • Website: http://www.paranoidferret.com
  • Location: Lafayette, IN
  • About Me:
    Even though I'm a programmer, I enjoy spending a lot of time outdoors - hiking, camping, etc. I spend most of my programming time in high level languages and user interface design. Most of my tutorials on this blog are about WPF, C#, or Javascript.

Published Tutorials (100)

Recent Comments

  • Create a Basic iPhone Audio Player with AV Foundation Framework
    08/27/2010 - 08:51

    I haven't had a chance yet to use the Audio Queue Services, so I haven't made a tutorial. Here's Apple's developer docs on Audio Queue Services that should get you started.

  • Image processing
    08/18/2010 - 10:00

    Where does it say the parameter is invalid. Does the debugger point to a line of code?

  • how to draw a square dot on mouse click on image picturebox c#
    08/18/2010 - 09:12

    Here's a solution. I subclassed PictureBox so I could override OnPaint. I tested this and it works pretty well.

    public class PictureBoxEx : PictureBox
    {
       List<Point> _points;

       public PictureBoxEx()
       {
          _points = new List<Point>();
          MouseDown += PictureBoxEx_MouseDown;
       }

       void PictureBoxEx_MouseDown(object sender, MouseEventArgs e)
       {
          _points.Add(new Point(e.X, e.Y));

          // Invalidate the control to cause it to repaint itself.
          this.Invalidate();
       }

       protected override void OnPaint(PaintEventArgs pe)
       {
          base.OnPaint(pe);

          foreach (var p in _points)
          {
             // Subtract 5 from the coords to center
             // the ellipse on the cursor.
             pe.Graphics.DrawEllipse(Pens.Green,
               new Rectangle(p.X - 5, p.Y - 5, 10, 10));
          }
       }
    }

    Simple add this control to your Form like you would any other PictureBox.

  • how to draw a square dot on mouse click on image picturebox c#
    08/17/2010 - 09:42

    What doesn't work in your code?

  • C# Tutorial - Simple Threaded TCP Server
    08/17/2010 - 08:43

    I noticed a potential problem in your code. You allocate buffer to the size of 8192, then immediate set the reference equal to the output of encoder.GetBytes. Next, while reading from the client, your attempting to read 8192 bytes into a buffer that's now much smaller.

  • WPF Tutorial - Using The ListView, Part 1
    08/11/2010 - 17:03

    By default the ToString method will be called on objects to generate what's displayed in the ListView. What you'll need to do is create a binding converter to convert the DateTime to the string you'd like displayed.

    DateTime has dozens of default string generators as well as accepting parameters to its overridden ToString to create pretty much any format you can imagine.

  • WPF Tutorial - Binding Converters
    08/11/2010 - 08:36

    You're definitely right about that. I'm not sure how we missed that one. Nice find!

  • Creating a Simple Windows Service in C#
    07/28/2010 - 10:35

    That would probably work.

  • Silverlight Tutorial - Animating Elements using Render Transforms
    07/28/2010 - 08:30

    The source is supposed to be attached to the article, but it's not. I'll have to hunt it down and get it attached.

  • Building a Silverlight Deep Zoom Application
    07/19/2010 - 20:25

    Since Silverlight is entirely client-side, all you have to do is find the output HTML file and open it directly in a web browser (file://...). Most of the time this is a very quick way to test the app - it's just that Silverlight's security prevents some things from working when the page is loaded from the hard drive like this.

    Other than that, I can't think of any reasons why the images wouldn't be loading. Double-check that the path you've specified is correct and the images are there.

Sponsors