473,769 Members | 7,923 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
GdipDrawRectang leI ai_Graphics, i_Pen, i_X, i_Y, i_Width, i_Height
GdipLoadImageFr omFile StrConv(astr_Wm fFile, vbUnicode), image

GdipDrawImageRe ct ai_Graphics, image, i_X, i_Y, i_Width, i_Height
GdipDeletePen i_Pen
GdipDisposeImag e image

I have the following code in VB.NET2005

Dim image As Image = New Bitmap(astr_Wmf File)

' Doesn't change anything in the problem

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

CurPen = New Pen(Color.Black , 1)

aCurGraph.DrawR ectangle(CurPen , i_X, i_Y, i_Width, i_Height)

aCurGraph.DrawI mage(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 2307
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
GdipDrawRectang leI ai_Graphics, i_Pen, i_X, i_Y, i_Width, i_Height
GdipLoadImageFr omFile StrConv(astr_Wm fFile, vbUnicode), image

GdipDrawImageRe ct ai_Graphics, image, i_X, i_Y, i_Width, i_Height
GdipDeletePen i_Pen
GdipDisposeImag e image

I have the following code in VB.NET2005

Dim image As Image = New Bitmap(astr_Wmf File)

' Doesn't change anything in the problem

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

CurPen = New Pen(Color.Black , 1)

aCurGraph.DrawR ectangle(CurPen , i_X, i_Y, i_Width, i_Height)

aCurGraph.DrawI mage(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.al lcomp.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
GdipDrawRectang leI ai_Graphics, i_Pen, i_X, i_Y, i_Width, i_Height
GdipLoadImageFr omFile StrConv(astr_Wm fFile, vbUnicode), image
GdipDrawImageRe ct ai_Graphics, image, i_X, i_Y, i_Width, i_Height
GdipDeletePen i_Pen
GdipDisposeImag e image
I have the following code in VB.NET2005
Dim image As Image = New Bitmap(astr_Wmf File)
' Doesn't change anything in the problem
'Dim image As Image = New Bitmap(New Bitmap(astr_Wmf File), New
System.Drawing. Size(i_Width, i_Height))
CurPen = New Pen(Color.Black , 1)
aCurGraph.DrawR ectangle(CurPen , i_X, i_Y, i_Width, i_Height)
aCurGraph.DrawI mage(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
3348
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 referenced, custom dll. I call a PrintImage routine in the dll and pass it only the the Picturebox.hdc from the main form. The dll's print routine draws to the hdc and it shows up in the picturebox perfectly. I would like to do a similar thing...
3
1964
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 connection could be made because the target machine actively refused it Server stack trace: at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket() at...
1
2444
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 AxInterop.MSComDlg.dll
5
2544
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 file? I've looked at Bitmap objects, which support saving, but can't see a way to grab what I have drawn and make a bitmap from it, or whatever. Anybody done this? Thanks for any suggestions
8
3924
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 objBaseView = new act.CAIBaseView(); act.CAIViews objViewsCollection = new act.CAIViews();
3
1650
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 time. I made a test program to isolate the problem from my program. Still same thing Basicly I have one application creating a file, the other application running the file watch procces. When a file with a certain extension is created, then a form...
1
912
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 also i share the folder of server which exe included and given all sharing permission, But error also, But in vb6 no problem working
2
1187
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
1691
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 We can See. But we Work in 800 * 600 screen resolution Only 15 we can sea. Other 5 is we cannot sea. Hoe to Over come This Faisal
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.