Navigation


Markus on Development and Publishing

This is Markus Egger's professional blog, which covers topics such as development, publishing, and business in general. As the publisher of CoDe and CoDe Focus magazines, and as the President and Chief Software Architect of EPS Software Corp., Markus shares his insights and opinions on this blog.

Content Area Footer

Friday, June 27, 2008
Why I use Twitter

I have gotten into using Twitter pretty heavily. In fact, I have been promoting it as a way within my company to promote better communications. As that, I have been sending around an internal email, trying to encourage people to check out Twitter. Some people have suggested to post that email here on my blog, so here I go:

If you haven’t used Twitter before, here’s what it does: Basically Twitter is a communication tool that is similar in some ways to IM or some even compare it to a very small blog. Basically, it is like being in a big room with all the people that you want to be connected with, and you can listen in to what they say (write) when you want.

Here’s why I like it:

  • It allows me to stay in contact with friends and business contacts.
  • I can absorb what people are doing without actively doing anything.
  • I follow Twitter when I want to, and I ignore it when I feel like it. Unlike Email or IM, Twitter never interrupts me.
  • People can follow what I do and thus get an idea of what technologies I work with and such. For instance, when I twitter that I work with WPF or VSX, someone who may eventually need WPF or VSX work now knows we do that. Similarly, people that follow me know when I work directly with Microsoft and such, which is often important to our customers.
  • I can put out questions and see if someone has an answer for it. I wouldn't’t send an email to 200 people, nor would I IM 200 people, but I could easily ask my Twitter “tribe” (as some are calling their list of friends).
  • Twitter is new and new communication mediums often allow for a more friendly communication approach. It is odd, but people on Twitter don’t mind being bothered about things that they would not want to be bothered about over email. Sure, this will change as time goes on, but right now, that’s the way it is.
  • It simply allows me to connect with a lot of people, and knowing people and being connected is the #1 way of producing business.
  • You can’t get spammed. You pick the people you want to have in your “tribe” and you will only see their stuff. You can also block people or keep them from following you.

And the list goes on, really. From an EPS internal point of view, communication is extremely important. Especially since we are an international company, communication is one of our greatest challenges. I often mention how hard it is not to walk into someone’s office to ask a question or how a lot of communication happens at lunch that off-site people are now missing out on. Twitter can at least provide part of this. I really encourage you to check it out.

You can sign up to Twitter at www.Twitter.com. It’s free. You can subscribe to follow those of us who are already on Twitter. Here are our personal URLs (in no particular order):

I think I didn’t forget anyone. As you can see, a lot of us are already on Twitter. I know some of you have said they do not like to write anything themselves. That is OK too. It is still cool to just follow along with what other people are doing. Writing anything yourself is optional. :-)

BTW: You can use Twitter by just using the Twitter web site. However, I prefer using some of the additional (free) tools such as Twhirl (www.Twhirl.org), which makes Twitter much more usable.

So are there things I do not like about Twitter? Absolutely! For one, the reliability of it sucks! I do not know any other site that is so unreliable. People say that is because the Twitter guys are overwhelmed, and that may be true in part, but it doesn't explain everything. For instance, they seem to be constantly breaking the API so third party apps like Twhirl have a hard time with that.

 

Posted @ 5:37 PM by Egger, Markus (markus@code-magazine.com) -
Comments (19)


Friday, June 27, 2008
Persisting WPF Objects as XAML or XPS

Here's another thing people ask me about frequently: How can any in-memory WPF object be persisted as XAML? Here's how:

string xaml = System.Windows.Markup.XamlWriter.Save(some object);

This gives you the XAML that can then be persisted in a file or wherever, and it can be loaded dynamically or you could even use it as a new file in a project that gets compiled in. (Note that the created XAML can be pretty nasty compared to XAML crafted by hand or an editor).

Note: The System.Windows.Markup namespace also features a XamlReader object, which can be used to dynamically load XAML during runtime.

A similar scenario calls for converting to XPS. (XPS is basically the WPF version of PDFs). XPS is also XAML, but it is a little different in that XPS is a print-like presentation of what something looks like. XPS may use graphical elements (shapes) to represent something on screen, which is somewhat different from he above example that preserves the XAML objects as they were. (Conversion to XAML always saves a button as a <Button>, while XPS does whatever it wants to create something that looks the same, but it isn't an interactive button).

XML documents can be really great if you want to preserve the look of something exactly as is. This is generally used to save FlowDocuments as XPS. Check out this blog post for some details on that.



Posted @ 2:45 PM by Egger, Markus (markus@code-magazine.com) -
Comments (41)


Friday, June 27, 2008
Converting GDI+ Images to WPF Bitmap Sources

Here is something I have shown as a little side-note at various conferences, and I have people sending me email about how I did it: Basically, this is about converting GDI+ Bitmap/Image objects to something WPF can consume. The trick is to convert the Image into BitmapSource objects, which can then be used on all kinds of WPF objects, such as images or brushes. Here is how to convert GDI+ Bitmaps into WPF BitmapSource objects:

Bitmap bmp = some bitmap...; // Replace with a real bitmap
BitmapSource bitmapSource = Imaging.CreateBitmapSourceFromHBitmap(
    bmp.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty,
    BitmapSizeOptions.FromEmptyOptions());

Sometimes, you may want to bind directly to a GDI+ bitmap object. In that case, you can create a ValueConverter object that does the conversion for you:

public class BitmapConverter : IValueConverter
{
    #region IValueConverter Members

    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        // Converts a GDI bitmap to an image source
        Bitmap bmp = value as Bitmap;
        if (bmp != null)
        {
            BitmapSource bitmapSource = Imaging.CreateBitmapSourceFromHBitmap(
                bmp.GetHbitmap(),
                IntPtr.Zero,
                Int32Rect.Empty,
                BitmapSizeOptions.FromEmptyOptions());
            return bitmapSource;
        }
        return null;
    }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        throw new NotImplementedException();
    }
    #endregion
}

That's it! Not much to it...



Posted @ 2:28 PM by Egger, Markus (markus@code-magazine.com) -
Comments (35)


 

 

 

 

 

 

 

Syndication RSS 2.0 RSS 2.0

All My Blogs:
My personal blogs:
Dev and Publishing Dev and Publishing
Travel and Internat. Living Travel and Internat. Living
Other blogs I contribute to:
Milos Blog (US) Milos Blog (US)
VFPConv. Dev Blog (US) VFPConv. Dev Blog (US)
VFPConv. Dev Blog (DE) VFPConv. Dev Blog (DE)

 

Blog Archives
All Blog Posts

2015
    September (1)
2012
    September (1)
    April (1)
    March (1)
2011
    October (1)
    June (3)
    May (1)
    March (2)
    February (2)
    January (2)
2010
    December (3)
    November (2)
    October (2)
    September (1)
    August (2)
    July (1)
    June (1)
    April (3)
    March (1)
    February (5)
    January (1)
2009
    October (4)
    September (2)
    August (1)
    July (1)
    May (4)
    April (6)
    February (1)
    January (1)
2008
    December (3)
    November (11)
    October (8)
    September (1)
    July (1)
    June (3)
    May (3)
    April (6)
    March (6)
    February (4)
2007
    December (1)
    November (1)
    October (5)
    September (1)
    August (1)
    July (6)
    June (3)
    May (3)
    April (1)
    March (2)
    January (2)
2006
    December (3)
    November (4)
    October (1)
    September (2)
    August (2)
    July (4)
    June (1)
    May (2)
    April (10)
    March (2)
    February (3)
    January (1)
2005
    December (6)
    November (7)
    October (6)
    September (8)
    August (10)
    July (6)
    June (9)

 

 

 

This Blog is powered by MilosTM Collaboration Components.