Home All Groups Group Topic Archive Search About

Problem drawing a WMF File VB.NET2005 (and Working in VB6)

Author
24 Oct 2007 1:23 PM
Marc Allard
Hello,
I have posted this message in the normal newsgroup instead of posting it in
the managed ones.


I have a project in VB6 (GDI+) that will read a WMF File (created by my
customer) and then resize it and insert it into a picture

I have a problem with in in NET2005 (but it is OK in VB6).

In the two cases, here are my common datas

My WMF is big as the units inside (after I load the image) is 2000 height,
and 1000 Width

Inside my WMF, I have some small lines (one pixel thickness).

The heith and Width of the rectangle where I put the picture is 200 height
and 100 Width (10 times smaller)



In VB6, every line is visible and has the same Width on the screen. That is
the result that I expect to have in NET2005

In VB.NET 2005, all the lines don't have the same thickness (some are
smaller than other ones) and some are even invisible.

Does anyone have any idea about how I could force NET2005 to put the same
thickness to the lines?



Here are the codes I have



In VB6, I have the following code



    GdipCreatePen1 GetGDIPlusColor(BLACK, 255), 1, Unit.UnitPixel, i_Pen
    GdipDrawRectangleI ai_Graphics, i_Pen, i_X, i_Y, i_Width, i_Height
    GdipLoadImageFromFile StrConv(astr_WmfFile, vbUnicode), image

    GdipDrawImageRect ai_Graphics, image, i_X, i_Y, i_Width, i_Height
    GdipDeletePen i_Pen
    GdipDisposeImage image





I have the following code in VB.NET2005



Dim image As Image = New Bitmap(astr_WmfFile)

' Doesn't change anything in the problem

'Dim image As Image = New Bitmap(New Bitmap(astr_WmfFile), New
System.Drawing.Size(i_Width, i_Height))

CurPen = New Pen(Color.Black, 1)

aCurGraph.DrawRectangle(CurPen, i_X, i_Y, i_Width, i_Height)

aCurGraph.DrawImage(image, i_X, i_Y, i_Width, i_Height)

CurPen.Dispose()



In the two cases,  i_X, i_Y,  i_Width, and i_Height are the position of the
rectangle where I must place the WMF File



Thank you

Marc Allard

Allcomp

Author
13 Nov 2007 3:14 PM
Marc Allard
Hello,

As it seems that no one has informations about it, can you please tell me
where I can find informations about this problem?
Should I open one of the cases I have as a MSDN suscriber (Certified Partner
- ISV)?

Thank you


Show quoteHide quote
"Marc Allard" wrote:

> Hello,
> I have posted this message in the normal newsgroup instead of posting it in
> the managed ones.

>
> I have a project in VB6 (GDI+) that will read a WMF File (created by my
> customer) and then resize it and insert it into a picture
>
> I have a problem with in in NET2005 (but it is OK in VB6).
>
> In the two cases, here are my common datas
>
> My WMF is big as the units inside (after I load the image) is 2000 height,
> and 1000 Width
>
> Inside my WMF, I have some small lines (one pixel thickness).
>
> The heith and Width of the rectangle where I put the picture is 200 height
> and 100 Width (10 times smaller)
>

>
> In VB6, every line is visible and has the same Width on the screen. That is
> the result that I expect to have in NET2005
>
> In VB.NET 2005, all the lines don't have the same thickness (some are
> smaller than other ones) and some are even invisible.
>
> Does anyone have any idea about how I could force NET2005 to put the same
> thickness to the lines?
>

>
> Here are the codes I have
>

>
> In VB6, I have the following code
>

>
>     GdipCreatePen1 GetGDIPlusColor(BLACK, 255), 1, Unit.UnitPixel, i_Pen
>     GdipDrawRectangleI ai_Graphics, i_Pen, i_X, i_Y, i_Width, i_Height
>     GdipLoadImageFromFile StrConv(astr_WmfFile, vbUnicode), image
>
>     GdipDrawImageRect ai_Graphics, image, i_X, i_Y, i_Width, i_Height
>     GdipDeletePen i_Pen
>     GdipDisposeImage image
>

>

>
> I have the following code in VB.NET2005
>

>
> Dim image As Image = New Bitmap(astr_WmfFile)
>
> ' Doesn't change anything in the problem
>
> 'Dim image As Image = New Bitmap(New Bitmap(astr_WmfFile), New
> System.Drawing.Size(i_Width, i_Height))
>
> CurPen = New Pen(Color.Black, 1)
>
> aCurGraph.DrawRectangle(CurPen, i_X, i_Y, i_Width, i_Height)
>
> aCurGraph.DrawImage(image, i_X, i_Y, i_Width, i_Height)
>
> CurPen.Dispose()
>

>
> In the two cases,  i_X, i_Y,  i_Width, and i_Height are the position of the
> rectangle where I must place the WMF File
>

>
> Thank you
>
> Marc Allard
>
> Allcomp
>
Author
13 Nov 2007 3:26 PM
rowe_newsgroups
On Nov 13, 10:14 am, Marc Allard <m...@nospam.allcomp.be> wrote:
Show quoteHide quote
> Hello,
>
> As it seems that no one has informations about it, can you please tell me
> where I can find informations about this problem?
> Should I open one of the cases I have as a MSDN suscriber (Certified Partner
> - ISV)?
>
> Thank you
>
> "Marc Allard" wrote:
> > Hello,
> > I have posted this message in the normal newsgroup instead of posting it in
> > the managed ones.
>
> > I have a project in VB6 (GDI+) that will read a WMF File (created by my
> > customer) and then resize it and insert it into a picture
>
> > I have a problem with in in NET2005 (but it is OK in VB6).
>
> > In the two cases, here are my common datas
>
> > My WMF is big as the units inside (after I load the image) is 2000 height,
> > and 1000 Width
>
> > Inside my WMF, I have some small lines (one pixel thickness).
>
> > The heith and Width of the rectangle where I put the picture is 200 height
> > and 100 Width (10 times smaller)
>
> > In VB6, every line is visible and has the same Width on the screen. That is
> > the result that I expect to have in NET2005
>
> > In VB.NET 2005, all the lines don't have the same thickness (some are
> > smaller than other ones) and some are even invisible.
>
> > Does anyone have any idea about how I could force NET2005 to put the same
> > thickness to the lines?
>
> > Here are the codes I have
>
> > In VB6, I have the following code
>
> >     GdipCreatePen1 GetGDIPlusColor(BLACK, 255), 1, Unit.UnitPixel, i_Pen
> >     GdipDrawRectangleI ai_Graphics, i_Pen, i_X, i_Y, i_Width, i_Height
> >     GdipLoadImageFromFile StrConv(astr_WmfFile, vbUnicode), image
>
> >     GdipDrawImageRect ai_Graphics, image, i_X, i_Y, i_Width, i_Height
> >     GdipDeletePen i_Pen
> >     GdipDisposeImage image
>
> > I have the following code in VB.NET2005
>
> > Dim image As Image = New Bitmap(astr_WmfFile)
>
> > ' Doesn't change anything in the problem
>
> > 'Dim image As Image = New Bitmap(New Bitmap(astr_WmfFile), New
> > System.Drawing.Size(i_Width, i_Height))
>
> > CurPen = New Pen(Color.Black, 1)
>
> > aCurGraph.DrawRectangle(CurPen, i_X, i_Y, i_Width, i_Height)
>
> > aCurGraph.DrawImage(image, i_X, i_Y, i_Width, i_Height)
>
> > CurPen.Dispose()
>
> > In the two cases,  i_X, i_Y,  i_Width, and i_Height are the position of the
> > rectangle where I must place the WMF File
>
> > Thank you
>
> > Marc Allard
>
> > Allcomp

I would post it it the managed group if you are an MSDN subscriber.

Thanks,

Seth Rowe
Author
13 Nov 2007 3:42 PM
Marc Allard
Hello,
I was thinking that I was in the managed ones.

I am on the Microsoft Web site where they say Managed Newsgroup.
(address http://msdn.microsoft.com/newsgroups/managed/default.aspx?......)

The Title is MSDN Home > MSDN Managed Newsgroup.

If it is not the correct managed newsgroup, can you please tell me where I
can find them?

Thank you


Marc Allard
Allcomp

Show quoteHide quote
"rowe_newsgroups" wrote:

> On Nov 13, 10:14 am, Marc Allard <m...@nospam.allcomp.be> wrote:
> > Hello,
> >
> > As it seems that no one has informations about it, can you please tell me
> > where I can find informations about this problem?
> > Should I open one of the cases I have as a MSDN suscriber (Certified Partner
> > - ISV)?
> >
> > Thank you
> >
> > "Marc Allard" wrote:
> > > Hello,
> > > I have posted this message in the normal newsgroup instead of posting it in
> > > the managed ones.
> >
> > > I have a project in VB6 (GDI+) that will read a WMF File (created by my
> > > customer) and then resize it and insert it into a picture
> >
> > > I have a problem with in in NET2005 (but it is OK in VB6).
> >
> > > In the two cases, here are my common datas
> >
> > > My WMF is big as the units inside (after I load the image) is 2000 height,
> > > and 1000 Width
> >
> > > Inside my WMF, I have some small lines (one pixel thickness).
> >
> > > The heith and Width of the rectangle where I put the picture is 200 height
> > > and 100 Width (10 times smaller)
> >
> > > In VB6, every line is visible and has the same Width on the screen. That is
> > > the result that I expect to have in NET2005
> >
> > > In VB.NET 2005, all the lines don't have the same thickness (some are
> > > smaller than other ones) and some are even invisible.
> >
> > > Does anyone have any idea about how I could force NET2005 to put the same
> > > thickness to the lines?
> >
> > > Here are the codes I have
> >
> > > In VB6, I have the following code
> >
> > >     GdipCreatePen1 GetGDIPlusColor(BLACK, 255), 1, Unit.UnitPixel, i_Pen
> > >     GdipDrawRectangleI ai_Graphics, i_Pen, i_X, i_Y, i_Width, i_Height
> > >     GdipLoadImageFromFile StrConv(astr_WmfFile, vbUnicode), image
> >
> > >     GdipDrawImageRect ai_Graphics, image, i_X, i_Y, i_Width, i_Height
> > >     GdipDeletePen i_Pen
> > >     GdipDisposeImage image
> >
> > > I have the following code in VB.NET2005
> >
> > > Dim image As Image = New Bitmap(astr_WmfFile)
> >
> > > ' Doesn't change anything in the problem
> >
> > > 'Dim image As Image = New Bitmap(New Bitmap(astr_WmfFile), New
> > > System.Drawing.Size(i_Width, i_Height))
> >
> > > CurPen = New Pen(Color.Black, 1)
> >
> > > aCurGraph.DrawRectangle(CurPen, i_X, i_Y, i_Width, i_Height)
> >
> > > aCurGraph.DrawImage(image, i_X, i_Y, i_Width, i_Height)
> >
> > > CurPen.Dispose()
> >
> > > In the two cases,  i_X, i_Y,  i_Width, and i_Height are the position of the
> > > rectangle where I must place the WMF File
> >
> > > Thank you
> >
> > > Marc Allard
> >
> > > Allcomp
>
> I would post it it the managed group if you are an MSDN subscriber.
>
> Thanks,
>
> Seth Rowe
>
>