Results 1 to 4 of 4

Thread: PictureBox Scaling - conversion problem from VB6 to VB.NET

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    1

    PictureBox Scaling - conversion problem from VB6 to VB.NET

    Hi Folks,

    We have a function like PictureBox.Scale(x1,y1)-(x2,y2) which scales the picturebox between the specified coordinates. Can any one tell me what is the equivalent of this in VB.net?

    My VB6 code is

    FrmTestData.DefInstance.Picture1.Scale (0, 1024) - (2048, 0)

    What is its equivalent in VB.NET?

    Thanks in advance

    Ken

  2. #2
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961
    in .Net, there is uitility called 'Upgrade Visual Basic 6 code' in Tools section. Type ur code in code editor and use this tool.

    I hope it helps

    regards

    prakash

  3. #3
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    Originally posted by pvbangera
    [B]in .Net, there is uitility called 'Upgrade Visual Basic 6 code' in Tools section. Type ur code in code editor and use this tool.

    I hope it helps
    B]

    it won't help at all.


    there is no exact equivalent to that very line, like there is no equivalent to the c# 'continue'. your just going to do what you were trying to do by using your own written dependencies.
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    The equivalent in .Net is to use an overloaded version of Graphics.DrawImage. Search the Vb.Net forums or google for more complete examples:

    VB Code:
    1. Dim g as Graphics = PictureBox1.CreateGraphics
    2. Dim srcRect = New Rectangle(XVal_From, YVal_From, Width, Height)
    3. g.DrawImage(PictureBox1.Image, XVal_To, YVal_To, srcRect, GraphicsUnit.Pixel)

    And the VB-equivalent for C# continue is quite irrelevant, since you simply construct another if not -end if statement to skip code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width