By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Oct 24 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Nov 13 '07 #2

P: n/a
On Nov 13, 10:14 am, Marc Allard <m...@nospam.allcomp.bewrote:
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

Nov 13 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.