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

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
 
G

Guest

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
 
R

rowe_newsgroups

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

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

Thanks,

Seth Rowe
 
M

Marc

Hello,

I have opened a case as no one knew the answer, and I was simply told
that instead of opening my WMF file in a Bitmap, I just had to open it
in a Metafile.

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top