Hello, I’m new in WPF, all my previous exp with drawings for Win is Win API, GDI+.
I'm surprised by the quality of drawing in Avalon. Please note, I do it from my code:
Ellipse es = new Ellipse();
es.Width = 20;
es.Height = 20;
es.Stroke = Brushes.Green;
es.StrokeThikness = 0.5
MyPanel.Children.Add(es);
What I got in result is a crappy GDI+ like pseudo circle... I sow some real nice examples of drawing with XAML (I can't use it by some reasons) - does that fact that I'm calling wpf from my code cause that, or I’m doing something wrong here
Thanks.

Quality of Drawings Q
jDeVoss
Hi Leonardo, it's actually very interesting :) I'd be surprised big time if you still use GDI+ (as my example shows).
I've got no VS.NET 2005 with WPF (Jan CTP) at work, so do following, please:
Create 2 circles one by XAML, another one within a code with the following set of properties:
Size 10 by 10. Note: Bigger sizes reduce the difference, although it's still visible.
Background: Transparent
Stroke - Blue.
StrokeThikness: 1
Take the magnifier and compare them (although it's visible for me even without it). The one which is rendered by the code (C#) - looks rather like an octagon (which made me thinking about old good GDI+ :), while the XMAL one looks just perfect.
Please let me know, if you encounter any difference.
Thanks, Al
Handi
Alex,
Drawing a circle using code instead of XAML should not make any difference.
Regards,
Deepak
JustJF
Hi Alex (nice name...),
We gave it a try and honestly can't see a difference... they look identical to us. We really do want to figure out what you're seeing though... would you mind sending me a screen-shot You should be able to just e-mail it to
alexander.stevenson@DeleteThisPart.microsoft.com
where, naturally, you have to take out the first part of the spam-resistant domain name.
Also if you have any details about what video card and driver version you're using that would be very interesting to me.
In theory, there shouldn't be any difference between xaml and code rendering because xaml actually compiles to code behind the scenes, and then that code gets compiled by your C# or VB compiler... so basically XAML is code. Parsing in-line xaml is a little different, but by the time it gets to our rendering engine it should have no idea how the object was created in any case. Of course, I've been around long enough to see all sorts of things happen that shouldn't... I'm just providing background on why we're so curious.
Thanks very much,
Alexander
Vishal_LogicaCMG
Alex,
Here is some code in which I draw an ellipse using both XAML and C#. They both look the same. I have just changed the height and width to be 200, so they look big. When you say it looks awful, do you mean it looks awful when done through code, or it just looks awful anyway
<
StackPanel Name="myPanel"><
Ellipse Width="200" Height="200" StrokeThickness="0.5" Stroke="Green"></Ellipse></
StackPanel>public
Window1(){
InitializeComponent();
this.Loaded += new RoutedEventHandler(Window1_Loaded);}
void Window1_Loaded(object sender, RoutedEventArgs e){
Ellipse es = new Ellipse();es.Width = 200;
es.Height = 200;
es.Stroke =
Brushes.Green;es.StrokeThickness = 0.5;
myPanel.Children.Add(es);
}
Peter-j-c
Hi Deepak, in fact it does a huge diff. Looks like for rendering of ellipses by the code force they STILL use GDI+ (based on quality). I actually found a hack - using EllipseGeometry in conjunction with Path gives me nice ellipses, although it's a bit of a heavy load…
This actually raises another question - which parts of WPF still use GDI+ at the back And what's the deadline for implementing true WPF all across the boundaries
Thanks, Alex
BranchL
MeirAmiel