G
Guest
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 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