SIGN UP MEMBER LOGIN:    
ARTICLE

Working with 2D Graphics in WPF

Posted by Raj Kumar Articles | Learn .NET October 03, 2007
This article provides an introduction of 2D drawings in WPF.
Reader Level:
Download Files:
 

Hey guys, in this article I am going explain how to draw home with 2D drawings in WPF.

This topic provides an overview of 3-D functionality in the Windows Presentation Foundation (WPF) graphics system. The WPF 3-D implementation allows developers to draw, transform, and animate 3-D graphics in both markup and procedural code, using the same capabilities afforded by the platform to 2-D graphics. Developers can combine 2-D and 3-D graphics to create rich controls, provide complex illustrations of data, or enhance the user experience of an application's interface. 3-D support in WPF is not designed to provide a full-featured game-development platform. Windows Presentation Foundation 3-D classes allow developers to create 3D models in Windows applications as a part of GUI.

Creating 3D Models involves following features:

  1. Creating 3D surfaces by defining more number of triangular surfaces
  2. Assigning Material property for the 3D model
  3. Creating light sources
  4. Creating camera to visualize the 3D model from different angle.
  5. Animating the models
  6. 3D graphics is to produce 2D images from 3D models suitable for displaying on an output such as your computer screen.

Here is snap shot.

Here is design:

<Grid>

    <Image>

        <Image.Source>

            <DrawingImage>

                <DrawingImage.Drawing>

                    <DrawingGroup x:Name="House">

                    <GeometryDrawing x:Name="Front" Brush="Orange" Geometry="M0,260 L0,600 L110,670 L110,500 L190,550 L190,710 L300,775 L300,430 L150,175">

                    </GeometryDrawing>

                    <GeometryDrawing x:Name="Side" Brush="Blue" Geometry="M300, 430 L300, 775 L600, 600 L600, 260">

                    </GeometryDrawing>

                    <GeometryDrawing x:Name="Roof" Brush="Yellow" Geometry="M150,175 L300, 430 L600, 260 L450, 0">

                    </GeometryDrawing>

                    </DrawingGroup>

                </DrawingImage.Drawing>           

            </DrawingImage>

        </Image.Source>       

    </Image>

</Grid>

 

I hope you will like this article. If yes drop me a line or write a comment below in the comments section.

Login to add your contents and source code to this article
share this article :
post comment
 

there is no explanation for coding

Posted by muthu karthikeyan Sep 09, 2011

thanks

Posted by mark zoombie Sep 09, 2009

Is it possible to make a 3D image in C# and then export it to "IGES" of "DXF" format ?

Posted by punit chauhan Jan 25, 2009
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Become a Sponsor