VG.net 1.7 Released

The Panning and Zooming Sample

A new sample program using VG.net vector graphics, called PanZoom, demonstrates how to use the new Zoom property in the Canvas class. The program uses this simple code to zoom in when the user clicks on a context menu:

    canvas.Zoom *= 1.25;

And this code to zoom out:

    canvas.Zoom /= 1.25;

Some other changes in this release:

  • Serialization to .myxaml xml files (see previous blog entry)
  • Centralization of Image storage in an ImageManager attached to each Picture. By using the ImageManager, we eliminated redundant storage of identical bitmaps within .resx files. ImageManager serves the same purpose as ImageList in windows forms, but is easier to use, since Images are referenced by name, not by index.
  • Many classes and properties were renamed. The API is now stable and can be used in production applications.

13 Comments

  • It's a very good software

  • Hey, this is really awesome stuff!



    What powers VG.net, if I may ask? I notice that it run fast - helluva lot faster than GDI+, which is not hardware accelerated yet, right?



    Is VG.NET tied into anything OS-specific? I just saw on the MyXaml forums that someone ported MyXaml to Linux, which I think is really cool.



    By the way, really awesome product you got here.

  • VG.net is built on top of GDI+. It seems much faster because we use various tricks to squeeze maximum performance out of GDI+. For example, we only redraw those pixels that need redrawing, using complex clip regions, not a simple bounding box union of the changed areas.



    VG.net also uses several general purpose graphics system optimizations we have developed over the years, that are not specific to GDI+. For example, if you modify several objects, they will not update the screen at once. Flags are set on objects, and changed objects are visited and rendered in one batch, on the next update pass. Memory-saving optimizations also speed up the display.



    VG.net is built in pure managed, safe code, written in C#. It could be ported to linux, but I don't think there is a really great port of GDI+ available right now. So we would have to figure out how to port the rendering layer.



    Thanks for all the nice comments!

  • Thanks for the reply! I was wondering why VG.net was so freaking fast. You do this stuff professionally for a living, I take it?



    On the issue of porting it to Linux, it might not be very hard: DotGNU has a fairly robust System.Drawing implementation (based on X11), and Mono is working hard to finish off their own System.Drawing implementation in time for their 1.0 release. Mono's is hosted on Cairo, a SVG rendering engine, so I assume its going to run like lightning on anything that has X11.

    They all have the same System.Drawing front-end/API, but work the drawing magick in their own back-ends before sending the result back through the front-end. Kinda hacky, but what isn't?



    To be honest, the concept of VG.NET + MyXaml (which was recently ported to Linux by one of the DotGNU guys - only had to replace one function call with another, he says) brings up an interesting prospect:



    Basically, a vector-graphics based "Swing for .NET."



    Even better, themeing would be a snap, given the ability for MyXaml to be wired to different UI toolkits. Just subclass, add the reference to the .xaml file, and run with it...

    Hell, maybe create all the controls IN MyXaml.

    Themeing is as easy as copying the originals and modifying the .xaml files.



    I brought up the issue of porting, of course, because .NET is sorely lacking in a crossplatform UI that does not need several pounds of runtime enviroment (*cough, GTK#, cough*).



    I'm interested in the prospect because it would be "nice" to have, and hacking around trying to create it sounds like fun.



    Using VG.Net to render components and using MyXaml as the declarative language to create the presentation layer for applications would be pretty sweet. The first crossplatform vector-based user interface toolkit, too; damn, man, I could be in the freaking Guiness book of world records!

  • Sorry so slow responding. I worked for many years on X windows, though not in the last few years. Unless things have changed dramatically, and X windows now supports anti-aliasing, gradients, transparency, etc., anything based on X windows would be inadequate for rendering.



    Yes, this is a professional effort. I have been building these types of systems since 1986. I worked on a product called SL-GMS for many years.



    Because we are doing it for a living, we are unlikely to port to another rendering layer unless there is some potential payback. Already VG.net represents a big investment for us.



  • Looks great!



    X has supported anti-aliased text, and the Gnome desktop uses SVG for icons (these are anti-aliased).



    I believe that at the X layer, the X consortium's implementation does not support transparency, but if you search for "Keith Packard" and transparency you'll find the new server that people are planning to move to (many distros have been disapointed with the X consortium's handling of X, and so the project has been forked to an organisation called FreeDesktop who are much more trusted and technically skilled). Look for the screenshots to see where that X implementation is at.

  • Yes, X afaik fully supports gradients, anti-aliasing and transparency (up to application level, meaning you won't be able to "see what's behind the application") by the use of the x-render extension. freedesktop.org's X-Server will take all of this a step further: http://freedesktop.org/~keithp/screenshots/

  • XFree/Xorg and the Sun X servers support porter-duff compositing via the XRENDER extension. The other things people are talking about in Keiths Xserver are related to some new extensions that have not hit mainstream yet like XCOMPOSITE and XDAMAGE.



    The nearest equivalent to GDI+ on Linux is called Cairo which has multiple rendering backends, for Xrender, image buffers, OpenGL etc. The OpenGL backend is called Glitz and allows for hardware accelerated 2D rendering. It's pretty new but performance feedback from it so far is excellent.

  • Oh, I forgot to mention, XRENDER also provides hardware acceleration for 2D drawing as well (not just compositing). I forget exactly how it works, but search for "RENDER trapezoids" and you should find something.

  • Is it possible to capture VG.dotnet picture to Clipboard or output as image file? Thanks a lot.

  • Programmtically, that function has not been added yet (RenderToBitmap) but it will be added soon. You can capture as a user with the Alt-PrintScrn key combination.

  • I did the MyXaml ports on Top of DotGNU ...



    Please have a look at http://packages.qa.debian.org/libg/libgdiplus.html



    And tell me if that'll be enough for Porting to DotGNU ?.



  • Hello t3rmin4t0r,



    Thanks for the link. I think there is no way for us to tell how well it will work without trying it, which unfortuantely, we don't have time to do right now (not even having a linux box). But I appreciate your help. Someday we will check it out.



    Thanks too, to all the other commenters, for giving me info. If we do get some funding or time for a unix port, we will look at those GDI+ libs first (easiest), then perhaps OpenGL, since that runs on the MS boxes as well, and would give us a huge perf boost. I have worked with OpenGL in the past. The problem is, it is a lower level library than GDI+.

Comments have been disabled for this content.