Re: [Mono-winforms-list] 1 pixel offset problem

2008-09-05 Thread Matt Zyzik
On Fri, Sep 05, 2008 at 10:25:10AM +0100, Ivan N. Zlatev wrote:
> On Fri, Sep 5, 2008 at 4:11 AM, Matt Zyzik <[EMAIL PROTECTED]> wrote:
> > With some more drawing experiments, I may have uncovered more bugs. I
> > need a confirmation. I attached two screenshots of renderings from both
> > frameworks (mono and ms.net), and they are noticeably different. The
> > common source code is attached as well.
> >
> > Let me know if these are bugs and if a bug report should be filed.
> >
> > --Matt
> >
> > P.S. I am using libgdiplus-110213 and mono-111509.
> >
> 
> If the results from the same test case is different then this is a bug
> and it should be filed.
> 

I filed a bug: 424002

--Matt
___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


Re: [Mono-winforms-list] 1 pixel offset problem

2008-09-05 Thread Matt Zyzik
On Fri, Sep 05, 2008 at 07:53:56AM -0400, Sebastien Pouliot wrote:
> Hello Matt,
> 
> > With some more drawing experiments, I may have uncovered more bugs. I
> > need a confirmation. I attached two screenshots of renderings from both
> > frameworks (mono and ms.net), and they are noticeably different. 
> 
> If you want a confirmation about something then you should define the
> differences.

If you switch back and forth between the renderings, you'll see that the
offsets of shapes are different.

> 
> A quick look shows some different colors. However you're using alpha for
> those colors and the form's background color is different in the two
> screenshots (which can explain the end result difference).

Yes, the colors are meaningless.

> 
> > The
> > common source code is attached as well.
> > 
> > Let me know if these are bugs and if a bug report should be filed.
> 
> In doubt always fill a bug report, including a test case (like this one)
> and a description of what is, in your opinion, wrong (missing). If it's
> not a real bug then it will be closed (with a comment why).

I will file a bug report later today.

--Matt
___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


Re: [Mono-winforms-list] 1 pixel offset problem

2008-09-05 Thread Sebastien Pouliot
On Thu, 2008-09-04 at 23:11 -0400, Matt Zyzik wrote:
> On Wed, Jul 30, 2008 at 11:43:04PM -0400, [EMAIL PROTECTED] wrote:
> > On Mon, Jul 28, 2008 at 02:38:10AM +0300, Ivan N. Zlatev wrote:
> > > [EMAIL PROTECTED] wrote:
> > > > I see another potentially related bug with drawing. I am trying to draw
> > > > some Bezier curves (with GraphicsPath); and the positioning and
> > > > appearance is way off (at least with respect to MS .NET).
> > > > 
> > > > Can someone comment on this? I have attached source code, makefile, and
> > > > two screenshots (ms.net/windows vs. mono/linux).
> > > > 
> > > 
> > > I see the bad rendering with SVN Head as well. Please file a bug[1] for 
> > > the  System.Drawing component with a good description of the problem, a 
> > > self-contained test case and the screenshots attached.
> > > 
> > > [1] http://mono-project.com/Bugs
> > > 
> > 
> > I just filed a bug (Bug #413461)
> > 
> > --Matt

Hello Matt,

> With some more drawing experiments, I may have uncovered more bugs. I
> need a confirmation. I attached two screenshots of renderings from both
> frameworks (mono and ms.net), and they are noticeably different. 

If you want a confirmation about something then you should define the
differences.

A quick look shows some different colors. However you're using alpha for
those colors and the form's background color is different in the two
screenshots (which can explain the end result difference).

> The
> common source code is attached as well.
> 
> Let me know if these are bugs and if a bug report should be filed.

In doubt always fill a bug report, including a test case (like this one)
and a description of what is, in your opinion, wrong (missing). If it's
not a real bug then it will be closed (with a comment why).

> 
> --Matt
> 
> P.S. I am using libgdiplus-110213 and mono-111509.
> ___
> Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list

___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


Re: [Mono-winforms-list] 1 pixel offset problem

2008-09-05 Thread Ivan N. Zlatev
On Fri, Sep 5, 2008 at 4:11 AM, Matt Zyzik <[EMAIL PROTECTED]> wrote:
> With some more drawing experiments, I may have uncovered more bugs. I
> need a confirmation. I attached two screenshots of renderings from both
> frameworks (mono and ms.net), and they are noticeably different. The
> common source code is attached as well.
>
> Let me know if these are bugs and if a bug report should be filed.
>
> --Matt
>
> P.S. I am using libgdiplus-110213 and mono-111509.
>

If the results from the same test case is different then this is a bug
and it should be filed.

-- 
Kind Regards,
Ivan N. Zlatev
___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


Re: [Mono-winforms-list] 1 pixel offset problem

2008-09-04 Thread Matt Zyzik
On Wed, Jul 30, 2008 at 11:43:04PM -0400, [EMAIL PROTECTED] wrote:
> On Mon, Jul 28, 2008 at 02:38:10AM +0300, Ivan N. Zlatev wrote:
> > [EMAIL PROTECTED] wrote:
> > > I see another potentially related bug with drawing. I am trying to draw
> > > some Bezier curves (with GraphicsPath); and the positioning and
> > > appearance is way off (at least with respect to MS .NET).
> > > 
> > > Can someone comment on this? I have attached source code, makefile, and
> > > two screenshots (ms.net/windows vs. mono/linux).
> > > 
> > 
> > I see the bad rendering with SVN Head as well. Please file a bug[1] for 
> > the  System.Drawing component with a good description of the problem, a 
> > self-contained test case and the screenshots attached.
> > 
> > [1] http://mono-project.com/Bugs
> > 
> 
> I just filed a bug (Bug #413461)
> 
> --Matt

With some more drawing experiments, I may have uncovered more bugs. I
need a confirmation. I attached two screenshots of renderings from both
frameworks (mono and ms.net), and they are noticeably different. The
common source code is attached as well.

Let me know if these are bugs and if a bug report should be filed.

--Matt

P.S. I am using libgdiplus-110213 and mono-111509.
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace SWFTest
{
/// 
/// Summary description for Form1.
/// 
public class Form1 : Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private System.ComponentModel.IContainer components;

SolidBrush pfsb;
LinearGradientBrush lgb;
GraphicsPath path;
Pen pFS;
int dX = 520;
int dY = 320;
int cirSize = 152;

public Form1()
{
pFS = new Pen(Color.Blue, 16);
lgb = new LinearGradientBrush(new Point(0,dY), new 
Point(0,dY+118), Color.FromArgb(160, Color.Blue), Color.Green);
pfsb = new SolidBrush(Color.FromArgb(150, 
Color.Orange));
path = new GraphicsPath(new Point[]
{
new 
Point(dX-64, dY-24),//start
new 
Point(dX-59, dY-34),//focal point 1
new 
Point(dX-52, dY-54),//focal point 2
new 
Point(dX-18, dY-66),//top
new 
Point(dX-34, dY-47),//focal point 1
new 
Point(dX-43, dY-27),//focal point 2
new 
Point(dX-44, dY-8),//end
}, new byte[]
{

(byte)PathPointType.Start,

(byte)PathPointType.Bezier,

(byte)PathPointType.Bezier,

(byte)PathPointType.Bezier,

(byte)PathPointType.Bezier,

(byte)PathPointType.Bezier,

(byte)PathPointType.Bezier,
});

InitializeComponent();

this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
}

protected override void OnPaint(PaintEventArgs e)
{
//draw the plus
e.Graphics.DrawLine(pFS, dX-100, dY, dX+100, dY);
e.Graphics.DrawLine(pFS, dX, dY-100, dX, dY+100);

//draw circle
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
e.Graphics.DrawEllipse(pFS, dX-(cirSize/2), 
dY-(cirSize/2), cirSize, cirSize);

//draw those pie chunks
e.Graphics.FillPie(pfsb, dX-cirSize/2, dY-cirSize/2, 
cirSize, cirSize, 0, 90);
 

Re: [Mono-winforms-list] 1 pixel offset problem

2008-07-30 Thread mzyzik
On Mon, Jul 28, 2008 at 02:38:10AM +0300, Ivan N. Zlatev wrote:
> [EMAIL PROTECTED] wrote:
> > I see another potentially related bug with drawing. I am trying to draw
> > some Bezier curves (with GraphicsPath); and the positioning and
> > appearance is way off (at least with respect to MS .NET).
> > 
> > Can someone comment on this? I have attached source code, makefile, and
> > two screenshots (ms.net/windows vs. mono/linux).
> > 
> 
> I see the bad rendering with SVN Head as well. Please file a bug[1] for 
> the  System.Drawing component with a good description of the problem, a 
> self-contained test case and the screenshots attached.
> 
> [1] http://mono-project.com/Bugs
> 

I just filed a bug (Bug #413461)

--Matt
___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


Re: [Mono-winforms-list] 1 pixel offset problem

2008-07-27 Thread Ivan N. Zlatev
[EMAIL PROTECTED] wrote:
> I see another potentially related bug with drawing. I am trying to draw
> some Bezier curves (with GraphicsPath); and the positioning and
> appearance is way off (at least with respect to MS .NET).
> 
> Can someone comment on this? I have attached source code, makefile, and
> two screenshots (ms.net/windows vs. mono/linux).
> 

I see the bad rendering with SVN Head as well. Please file a bug[1] for 
the  System.Drawing component with a good description of the problem, a 
self-contained test case and the screenshots attached.

[1] http://mono-project.com/Bugs

Kind Regards,
-- 
Ivan N. Zlatev

Web: http://www.i-nZ.net
"It's all some kind of whacked out conspiracy."
___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


Re: [Mono-winforms-list] 1 pixel offset problem

2008-07-24 Thread Ernesto
Ivan N. Zlatev escribió:
> Ernesto wrote:
>   
>> Hi,
>>
>> I noticed that System.Drawing primitives will sometimes render things 
>> with a one pixel offset. I noticed that this affects MWF too, and I 
>> understand this is a libgdi problem, probably related to the fact that 
>> cairo takes pixel coordinates in a different way than Windows' GDI+.
>> The attached screenshot shows the problem in the Cancel button right 
>> border of a MessageBox
>
> Seems like you are using an old libgdiplus with a newer MWF. What 
> versions of Mono and libgdiplus have you got installed?
>   

Oh... I didn't know it could be a version problem. I'll try updating 
lidgdiplus.
BTW, I'm using libgdiplus0-1.9-2 with mono 2.0 or trunk.


Regards,
Ernesto

___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


Re: [Mono-winforms-list] 1 pixel offset problem

2008-07-24 Thread Ivan N. Zlatev
Ernesto wrote:
> Hi,
> 
> I noticed that System.Drawing primitives will sometimes render things 
> with a one pixel offset. I noticed that this affects MWF too, and I 
> understand this is a libgdi problem, probably related to the fact that 
> cairo takes pixel coordinates in a different way than Windows' GDI+.
> The attached screenshot shows the problem in the Cancel button right 
> border of a MessageBox.
> 

Seems like you are using an old libgdiplus with a newer MWF. What 
versions of Mono and libgdiplus have you got installed?

> I'm willing to try to fix this, but I wanted to ask first if this is a 
> known issue or limitation of the current gdiplus implementation.
> 

-- 
Ivan N. Zlatev

Web: http://www.i-nZ.net
"It's all some kind of whacked out conspiracy."
___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


[Mono-winforms-list] 1 pixel offset problem

2008-07-24 Thread Ernesto


Hi,

I noticed that System.Drawing primitives will sometimes render things 
with a one pixel offset. I noticed that this affects MWF too, and I 
understand this is a libgdi problem, probably related to the fact that 
cairo takes pixel coordinates in a different way than Windows' GDI+.
The attached screenshot shows the problem in the Cancel button right 
border of a MessageBox.


I'm willing to try to fix this, but I wanted to ask first if this is a 
known issue or limitation of the current gdiplus implementation.


Regards,
Ernesto

<>___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list