473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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

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
2 2283
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Metallicraft | last post by:
I have a vb6 application. On the main form is a picture box with one or two images and several pieces of text displayed in it. These are created on the fly using gdi32 routines that are all in a...
3
by: fong01 | last post by:
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.Net.Sockets.SocketException: No...
1
by: DivB | last post by:
Hello, I have a nice application compiled with the first Visual Studio.net release. It's a converted VB6 app. I'm also using this files: Interop.DxVBLibA.dll Interop.MSComDlg.dll...
5
by: Steve Marshall | last post by:
Hi all, I am converting an app which used a picturebox to draw graphs etc onto, then saved them to a file. I can certainly draw things onto a picturbox in VB.NET, but how do I save them to a...
8
by: Gary | last post by:
I'm using an Act database. I was stuck on this a year ago and am still having trouble. I have three bits of code like so : - act.CActAppObj objACT = new act.CActAppObj(); act.CAIBaseView...
3
by: =?Utf-8?B?UnVkeQ==?= | last post by:
Hello All! I may have posted this problem before, but it was awhile ago. I'm working in VS 2003. I have 10 file watch process going. It seems that I can only about 6or 7 to run at the same...
1
mafaisal
by: mafaisal | last post by:
Hello Experts I am Using VB.net2005 My Problem is I am Create Exe in Server, And i Short cut of that put in to Client machine then an error is come i install framework of .net in client also...
2
mafaisal
by: mafaisal | last post by:
Hello Experts I am Using vb.net2005 How To Know a File or Folde is Exist in Specific Folder Using vb.net2005 eg : test.txt this file is exist in D:\Faisal Hw to check this Faisal
4
mafaisal
by: mafaisal | last post by:
Hello, I am Using Vb.Net2005. Project is Desktop Application In Mdi Parent Form I Have 20 Toolstrip Menu Items. I am Developed in 1024 * 768 screen resolution. When we working that All Menu Item...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.