Feng Yuan (袁峰)

CLR, Performance, Debugging, Parallel Computing, WPF, XPS, GDI, GDI+, Printing (www.fengyuan.com)

Posts
  • Feng Yuan (袁峰)

    Convert XAML Flow Document to XPS with Style (multiple page, page size, header, margin)

    • 28 Comments
    XPS is a fixed document format in which pages are pre-formated to a fixed page sixe. On the opposite of the spectrum, WPF provides flow document which can be paginated dynamically in XAML viewer. To bridge the two, WPF provides features to convert a flow...
  • Feng Yuan (袁峰)

    Creating XPS Documents from Visual, plus an insider look at an XPS Document

    • 10 Comments
    In the last article blogs.msdn.com/fyuan/archive/2005/09/11/463708 , we discussed how to generate XPS Documents from Win32 applications using the XPS Document Writer. The procedure is very simple, can you simply print whatever contents you have using...
  • Feng Yuan (袁峰)

    Printing documents to Microsoft XPS Document Writer without user interaction

    • 19 Comments
    Now that the XPS storm has been started, people are generating XPS documents from all kinds of sources. Among different ways of XPS generation, the easily way is still through printing to the Microsoft XPS Document Writer (the MXDW printer driver). ...
  • Feng Yuan (袁峰)

    Generating XPS Document from Win32 Applications: the XPS Document Writer

    • 4 Comments
    At Winhec 2005, Microsoft announced a new file format code named Metro (Modular Content Framework and Document Format). The name Metro has since been retired and replaced with the official name XPS which stands for XML Paper Specification. XPS is...
  • Feng Yuan (袁峰)

    Modifying XPS Document: Add Watermark

    • 21 Comments
    Windows Platform Foundation has provided easy APIs and solutions for XPS document generation, visualization and printing. But often time, after XPS documents are generated, we would like to modify it in certain way. The scenario I'm trying to demonstrate...
  • Feng Yuan (袁峰)

    Source code for Windows Graphics Programming: Win32 GDI and DirectDraw

    • 4 Comments
    Source code for Windows Graphics Programming: Win32 GDI and DirectDraw used to be on http://safariexamples.informit.com/0130869856/ . But link has been broken for quite sometimes. I've received a few emails from readers who has lost the CD of the book...
  • Feng Yuan (袁峰)

    Bought a new computer: HP Media Center PC m7334n with AMD Athlon 64 X2 3800

    • 16 Comments
    My desktop computer at home is about five years old, so I thought it's time to buy myself a new computer. There are two features I'm particularly interested in new computer: media center PC and AMD 64-bit CPU. So I looked around for a Media Center PC...
  • Feng Yuan (袁峰)

    A Simple XPS Decoder in C++

    • 10 Comments
    If you write programs in C#, Windows Presentation Foundation in .Net 3.0 provides quite nice API to write, generate and manipulate XPS documents. You can get the same feature if you work with managed C++ in .Net 3.0. Even if you work with .Net 2.0, you...
  • Feng Yuan (袁峰)

    Printing to Microsoft XPS Document Writer without showing File Save Dialog Box

    • 14 Comments
    If you want to use the Microsoft XPS Writer to generate a large amount of XPS Documents, or use it in a server environment, you do not want the File Save dialog box to show up. Solution: specify output file name in DOCINFO passed to StartDoc....
  • Feng Yuan (袁峰)

    Windows Graphics Programming: Win32 GDI and DirectDraw (ISBN 0130869856) reprint is here !

    • 16 Comments
    Windows Graphics Programming: Win32 GDI and DirectDraw has been out of print for quite sometimes. I tried several times to convince the publisher to reprint it because people are still programming using Win32 API, but they would not do it, quoting that...
  • Feng Yuan (袁峰)

    Anatomy of STL Vector: Data Size

    • 1 Comments
    In the last post, we discussed the cost of using STL vector to module size. Now let’s take a look at how STL vector manages its data. Dia2Dump (Source code available in Microsoft Visual Studio 8\Dia SDK\Samples\Dia2Dump directory) shows the following...
  • Feng Yuan (袁峰)

    Performance Tips: System.Text.StringBuilder and String.Concat

    • 3 Comments
    Much has been written about the benefits of using StringBuilder over string concatenation. So much so that there seems to be overuse of StringBuilder class, causing performance issues again. If you're using StringBuilder and string concatenation a...
  • Feng Yuan (袁峰)

    Self introduction

    • 15 Comments
    Hello, world of blogging, This is Feng Yuan, a software design engineer with Microsoft. I joined Microsoft three years ago, after working on printer drivers for HP for several years. Since then, I have been working on GDI, GDI+, Avalon and printing...
  • Feng Yuan (袁峰)

    Anatomy of Radial Gradient Brush

    • 4 Comments
    WPF(Windows Presentation Foundation) and XPS (Open XML Paper Specification) supports five types of brushes. They are solid color brush, linear gradient brush, radial gradient brush, image brush, and visual brush. This posting will discuss the 'shape'...
  • Feng Yuan (袁峰)

    XpsStat: A program for gathering statistics information of XPS documents

    • 5 Comments
    In the Winhec presentation on XPS document performance optimization, a simple program XpsStat is introduced to analyze XPS documents. Given an XPS document, XpsStat generates four or five tables in HTML format: Container Summary Table: information...
  • Feng Yuan (袁峰)

    Know a good book on performance?

    • 5 Comments
    If you know a good book or more on performance, please recommend. I'm aware of the following books which have some topics related to software performance: Dov Bulka, David Mayhew, Efficient C++: Performance Programming Techniques , 2000. This...
  • Feng Yuan (袁峰)

    The XPS (XML Paper Specification) Depot

    • 5 Comments
    One stop shop for XPS information...
  • Feng Yuan (袁峰)

    Printing to legacy devices in Windows Presentation Foundation

    • 2 Comments
    In the two previous postings, we discussed about two different ways of generating XPS (XML Paper Specification) Documents, one being printing to XPS Document Writer from Win32 applications, and the other being using the new WPF (Windows Presentation Foundation...
  • Feng Yuan (袁峰)

    Anatomy of STL vector: Module Size

    • 3 Comments
    If you need a dynamic array in C++, a widely used class is the vector template class in STL. There are even books recommending replacement of plain C++ array with STL vector. This series is going to look at how STL vector is implemented and what...
  • Feng Yuan (袁峰)

    The difference between an amature and professional plumber

    • 9 Comments
    An amature plumber makes multiple trips to Home Depot to buy supplies, a professional plumber gets supply from his/her truck. An amature plumber listens to whatever advise other people gives, a professional plumber does not need them. An amature...
  • Feng Yuan (袁峰)

    XPS document with 100,000 pages?

    • 2 Comments
    Once a simple document format like XPS is created, it takes on a life of its own. Seeing the beauty of XPS, people are converting documents from differenent sources to XPS. People are trying to create XPS document with 10,000 pages, and even pushing for...
  • Feng Yuan (袁峰)

    XPS at Winhec 2007

    • 1 Comments
    Today (May 15, 2007) is the first day of Winhec 2007. If you're application developers, printer/scanner/multi-functional device vendors, you may be interested in the following XPS related sessions. CLN-T370 XPSDrv: Best Practice using Print Verifier...
  • Feng Yuan (袁峰)

    XPS Performance

    • 1 Comments
    There will be two XPS related sessions at Winhec 2007 tomorrow, focusing on Performance Optimization for XPS Document. The techincal presentation (CLN-T371 ) will be at 8:30am to 9:30am in Room 502AB. Shortly after that (9:45 to 10:45), there will...
  • Feng Yuan (袁峰)

    DIY generation of XPS Documents

    • 0 Comments
    Although Microsoft has already provided two ways to generate XPS Documents, there are benefits to generate them on your own. Here is some sample Win32 code for generating XPS Fixedpage markup....
  • Feng Yuan (袁峰)

    Another Ph.D for Bill Gates

    • 2 Comments
    On April 19th, Bill Gates has been awarded a honorary Ph.D degree by Tsinghua University ( http://en.wikipedia.org/wiki/Tsinghua_University) , the best engineering school in China.
Page 1 of 3 (61 items) 123