Moving character Glyphs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?TWFyaw==?=

    Moving character Glyphs

    I modified a C# application from Bob Powell that moves graphics primitives
    around on the screen into a Vb.NET 2005 application. I want to modify this
    application so along with moving regular geometric shapes, I can also move
    the alphanumeric characters as well. For example I place the character "A" on
    the screen and when I point to it with the mouse the character will be
    outlined and while holding down the left mouse button move the "A" somewhere
    else on the screen.

    Since I learn best by example I wrote another class for the Characters, but
    it doesn't work. I asked Bob Powell and he suggested I convert the characters
    to glyphs and hit test these, but since VB.NET's only resembalance to the
    Visual Basic programming language is in name only I'm now completely lost.

    Here is the Class I wrote:
    Public Class DrawText
    Inherits Primitive

    Public Sub New()
    MyBase.New()
    End Sub

    Public Overloads Overrides Sub Draw(ByVal g As Graphics)
    Dim b As New SolidBrush(Me.C olor)
    Dim txt As String = "Aa"
    'Dim big_font As New Font("Times New Roman", 30, FontStyle.Bold)
    'g.TextRenderin gHint =
    Drawing.Text.Te xtRenderingHint .AntiAliasGridF it
    'g.DrawString(t xt, big_font, Brushes.Black, 10, 100)

    'g.FillRectangl e(b, New Rectangle(Me.Lo cation, Me.Size))
    'b.Dispose()

    'Create a GraphicsPath
    Dim graphics_path As New Drawing2D.Graph icsPath
    'Add some text to the path
    graphics_path.A ddString(txt, _
    New FontFamily("Tim es New Roman"), _
    CInt(FontStyle. Bold), _
    80, New Point(10, 100), _
    StringFormat.Ge nericTypographi c)

    g.SmoothingMode = Drawing2D.Smoot hingMode.AntiAl ias
    g.FillPath(Brus hes.White, graphics_path)
    g.DrawPath(New Pen(Drawing.Col or.Black, 3), graphics_path)
    b.Dispose()
    If Highlight Then
    Dim p As New Pen(Drawing.Col or.Red, 3)
    p.DashStyle = Drawing2D.DashS tyle.DashDot
    g.DrawRectangle (p, New Rectangle(Me.Lo cation, Me.Size))
    p.Dispose()
    End If
    End Sub

    Public Overloads Overrides Function HitTest(ByVal p As Point) As
    Boolean
    Dim pth As New Drawing2D.Graph icsPath()
    pth.AddEllipse( New Rectangle(Locat ion, Size))
    Dim retval As Boolean = pth.IsVisible(p )
    pth.Dispose()
    Return retval
    End Function
    End Class

    Can someone tell me what I'm doing wrong?
    --
    Mark
  • Mike Williams

    #2
    Re: Moving character Glyphs

    "Mark" <Mark@discussio ns.microsoft.co mwrote in message
    news:F9906801-F032-4B21-8E86-ACB403DE7C70@mi crosoft.com...
    I modified a C# application from Bob Powell that moves graphics
    primitives around on the screen into a Vb.NET 2005 application.
    I want to modify this application so along with moving regular
    geometric shapes, I can also move the alphanumeric characters as
    well. Since I learn best by example I wrote another class for the
    Characters, but it doesn't work. I asked Bob Powell and he
    suggested I convert the characters to glyphs and hit test these,
    but since VB.NET's only resembalance to the Visual Basic
    programming language is in name only I'm now completely lost.
    That's very strange. I am a VB6 programmer looking for somewhere to move to
    and I am being told by a few people, specifically someone called Bill
    McCarthy on this very newsgroup, that vb.net is indeed compatible with VB6.
    But you are saying that, "VB.Net's only resemblance to the Visual Basic
    programming language is in name only"? Are you sure you are correct about
    that? Presumably you have some experience with vb.net programming? Is it
    your opinion that vb.net is not compatible with VB6 after all? Bill McCarthy
    says that it is, and I have been relying on his advice.

    Mike



    Comment

    • Cor Ligthert[MVP]

      #3
      Re: Moving character Glyphs

      Mark,

      Drawing is typical Bob. So your only hope is that he sees this, or that you
      mail him on his home page.

      At first sight I don't see any trouble in your code, but you can test it
      yourself better by setting a breakpoint and than see what happens.



      I see he has still his old website (very old MVP logo) so I don't know of
      the email is valid.

      Cor

      "Mark" <Mark@discussio ns.microsoft.co mschreef in bericht
      news:F9906801-F032-4B21-8E86-ACB403DE7C70@mi crosoft.com...
      >I modified a C# application from Bob Powell that moves graphics primitives
      around on the screen into a Vb.NET 2005 application. I want to modify this
      application so along with moving regular geometric shapes, I can also move
      the alphanumeric characters as well. For example I place the character "A"
      on
      the screen and when I point to it with the mouse the character will be
      outlined and while holding down the left mouse button move the "A"
      somewhere
      else on the screen.
      >
      Since I learn best by example I wrote another class for the Characters,
      but
      it doesn't work. I asked Bob Powell and he suggested I convert the
      characters
      to glyphs and hit test these, but since VB.NET's only resembalance to the
      Visual Basic programming language is in name only I'm now completely lost.
      >
      Here is the Class I wrote:
      Public Class DrawText
      Inherits Primitive
      >
      Public Sub New()
      MyBase.New()
      End Sub
      >
      Public Overloads Overrides Sub Draw(ByVal g As Graphics)
      Dim b As New SolidBrush(Me.C olor)
      Dim txt As String = "Aa"
      'Dim big_font As New Font("Times New Roman", 30,
      FontStyle.Bold)
      'g.TextRenderin gHint =
      Drawing.Text.Te xtRenderingHint .AntiAliasGridF it
      'g.DrawString(t xt, big_font, Brushes.Black, 10, 100)
      >
      'g.FillRectangl e(b, New Rectangle(Me.Lo cation, Me.Size))
      'b.Dispose()
      >
      'Create a GraphicsPath
      Dim graphics_path As New Drawing2D.Graph icsPath
      'Add some text to the path
      graphics_path.A ddString(txt, _
      New FontFamily("Tim es New Roman"), _
      CInt(FontStyle. Bold), _
      80, New Point(10, 100), _
      StringFormat.Ge nericTypographi c)
      >
      g.SmoothingMode = Drawing2D.Smoot hingMode.AntiAl ias
      g.FillPath(Brus hes.White, graphics_path)
      g.DrawPath(New Pen(Drawing.Col or.Black, 3), graphics_path)
      b.Dispose()
      If Highlight Then
      Dim p As New Pen(Drawing.Col or.Red, 3)
      p.DashStyle = Drawing2D.DashS tyle.DashDot
      g.DrawRectangle (p, New Rectangle(Me.Lo cation, Me.Size))
      p.Dispose()
      End If
      End Sub
      >
      Public Overloads Overrides Function HitTest(ByVal p As Point) As
      Boolean
      Dim pth As New Drawing2D.Graph icsPath()
      pth.AddEllipse( New Rectangle(Locat ion, Size))
      Dim retval As Boolean = pth.IsVisible(p )
      pth.Dispose()
      Return retval
      End Function
      End Class
      >
      Can someone tell me what I'm doing wrong?
      --
      Mark

      Comment

      • Cor Ligthert[MVP]

        #4
        OT: Re: Moving character Glyphs

        Mike,
        That's very strange. I am a VB6 programmer looking for somewhere to move
        to and I am being told by a few people, specifically someone called Bill
        McCarthy on this very newsgroup, that vb.net is indeed compatible with
        VB6. But you are saying that, "VB.Net's only resemblance to the Visual
        Basic programming language is in name only"? Are you sure you are correct
        about that? Presumably you have some experience with vb.net programming?
        Is it your opinion that vb.net is not compatible with VB6 after all? Bill
        McCarthy says that it is, and I have been relying on his advice.
        What Bill writes is very true, the languages VB7, VB7.1 VB8 and VB9 are
        almost completely upwards compatible with VB6.

        However the tool Visual Basic '98 (1998) is very much different, this tool
        was in fact for Com (as there was no Net).

        The tools after Visual Basic 1998 (numbered 2002, 2003 2005 and 2008 with
        different versions) were made for Net, while it is still possible to use
        Com. However most classes which are delivered with Visual Basic '98 are in
        the latter version im the Microsoft Visual Basic compatible namespace, which
        is not like the Microsoft.Visua lBasic namespace an official namespace from
        Net and probably will disapear in future. The latter is also very bad to
        handle in Visual Studio version behind the start of this millenium, while
        some classes are not even in that, by instance the FlexGrid, which is a
        crime to use in Visual Studio 2002-2008

        So as you write that the program language VB6 is not compatible with VB.Net
        then you are comparing apples and pears (Nothing wrong with that because
        that is the way it is mostly incorrect written, including by me).

        The tool Visual Basic '98 is not compatible with the Visual Studio Tools
        behind that, however all VB program language versions are very much upwards
        compatible with all VB versions AFAIK starting at VB1.

        I hope this clears your misunderstandin g a little bit. However Bill is in my
        opinion right with his statement.

        Cor


        Comment

        • Cor Ligthert[MVP]

          #5
          Re: Re: Moving character Glyphs

          Correction, the name of the tool was not Visual Basic 98 however Visual
          Studio 6 (not VB6)

          Cor

          "Cor Ligthert[MVP]" <notmyfirstname @planet.nlschre ef in bericht
          news:971F5330-9FC2-4A1C-A362-995A421A851A@mi crosoft.com...
          Mike,
          >
          >That's very strange. I am a VB6 programmer looking for somewhere to move
          >to and I am being told by a few people, specifically someone called Bill
          >McCarthy on this very newsgroup, that vb.net is indeed compatible with
          >VB6. But you are saying that, "VB.Net's only resemblance to the Visual
          >Basic programming language is in name only"? Are you sure you are correct
          >about that? Presumably you have some experience with vb.net programming?
          >Is it your opinion that vb.net is not compatible with VB6 after all? Bill
          >McCarthy says that it is, and I have been relying on his advice.
          >
          What Bill writes is very true, the languages VB7, VB7.1 VB8 and VB9 are
          almost completely upwards compatible with VB6.
          >
          However the tool Visual Basic '98 (1998) is very much different, this tool
          was in fact for Com (as there was no Net).
          >
          The tools after Visual Basic 1998 (numbered 2002, 2003 2005 and 2008 with
          different versions) were made for Net, while it is still possible to use
          Com. However most classes which are delivered with Visual Basic '98 are in
          the latter version im the Microsoft Visual Basic compatible namespace,
          which is not like the Microsoft.Visua lBasic namespace an official
          namespace from Net and probably will disapear in future. The latter is
          also very bad to handle in Visual Studio version behind the start of this
          millenium, while some classes are not even in that, by instance the
          FlexGrid, which is a crime to use in Visual Studio 2002-2008
          >
          So as you write that the program language VB6 is not compatible with
          VB.Net then you are comparing apples and pears (Nothing wrong with that
          because that is the way it is mostly incorrect written, including by me).
          >
          The tool Visual Basic '98 is not compatible with the Visual Studio Tools
          behind that, however all VB program language versions are very much
          upwards compatible with all VB versions AFAIK starting at VB1.
          >
          I hope this clears your misunderstandin g a little bit. However Bill is in
          my opinion right with his statement.
          >
          Cor
          >
          >

          Comment

          • Bill McCarthy

            #6
            Re: Re: Moving character Glyphs

            Actually it was named VB6, or at least the exe was. But it was installed in
            the VB98 folder by default.


            "Cor Ligthert[MVP]" <notmyfirstname @planet.nlwrote in message
            news:427AD3EE-43A3-46AA-A2CD-1F9AA1E2BAB6@mi crosoft.com...
            Correction, the name of the tool was not Visual Basic 98 however Visual
            Studio 6 (not VB6)
            >
            Cor
            >
            "Cor Ligthert[MVP]" <notmyfirstname @planet.nlschre ef in bericht
            news:971F5330-9FC2-4A1C-A362-995A421A851A@mi crosoft.com...
            >Mike,
            >>
            >>That's very strange. I am a VB6 programmer looking for somewhere to move
            >>to and I am being told by a few people, specifically someone called Bill
            >>McCarthy on this very newsgroup, that vb.net is indeed compatible with
            >>VB6. But you are saying that, "VB.Net's only resemblance to the Visual
            >>Basic programming language is in name only"? Are you sure you are
            >>correct about that? Presumably you have some experience with vb.net
            >>programming ? Is it your opinion that vb.net is not compatible with VB6
            >>after all? Bill McCarthy says that it is, and I have been relying on his
            >>advice.
            >>
            >What Bill writes is very true, the languages VB7, VB7.1 VB8 and VB9 are
            >almost completely upwards compatible with VB6.
            >>
            >However the tool Visual Basic '98 (1998) is very much different, this
            >tool was in fact for Com (as there was no Net).
            >>
            >The tools after Visual Basic 1998 (numbered 2002, 2003 2005 and 2008
            >with different versions) were made for Net, while it is still possible to
            >use Com. However most classes which are delivered with Visual Basic '98
            >are in the latter version im the Microsoft Visual Basic compatible
            >namespace, which is not like the Microsoft.Visua lBasic namespace an
            >official namespace from Net and probably will disapear in future. The
            >latter is also very bad to handle in Visual Studio version behind the
            >start of this millenium, while some classes are not even in that, by
            >instance the FlexGrid, which is a crime to use in Visual Studio 2002-2008
            >>
            >So as you write that the program language VB6 is not compatible with
            >VB.Net then you are comparing apples and pears (Nothing wrong with that
            >because that is the way it is mostly incorrect written, including by me).
            >>
            >The tool Visual Basic '98 is not compatible with the Visual Studio Tools
            >behind that, however all VB program language versions are very much
            >upwards compatible with all VB versions AFAIK starting at VB1.
            >>
            >I hope this clears your misunderstandin g a little bit. However Bill is in
            >my opinion right with his statement.
            >>
            >Cor
            >>
            >>
            >

            Comment

            • Cor Ligthert[MVP]

              #7
              Re: Re: Moving character Glyphs

              Bill,

              Because I was in doubt I took the old installation CD, on that was written
              Visual Studio 6

              Cor

              "Bill McCarthy" <Bill@N0SPAM.co mschreef in bericht
              news:D0AC10E5-2028-4629-B566-7B650A558A12@mi crosoft.com...
              Actually it was named VB6, or at least the exe was. But it was installed
              in the VB98 folder by default.
              >
              >
              "Cor Ligthert[MVP]" <notmyfirstname @planet.nlwrote in message
              news:427AD3EE-43A3-46AA-A2CD-1F9AA1E2BAB6@mi crosoft.com...
              >Correction, the name of the tool was not Visual Basic 98 however Visual
              >Studio 6 (not VB6)
              >>
              >Cor
              >>
              >"Cor Ligthert[MVP]" <notmyfirstname @planet.nlschre ef in bericht
              >news:971F533 0-9FC2-4A1C-A362-995A421A851A@mi crosoft.com...
              >>Mike,
              >>>
              >>>That's very strange. I am a VB6 programmer looking for somewhere to
              >>>move to and I am being told by a few people, specifically someone
              >>>called Bill McCarthy on this very newsgroup, that vb.net is indeed
              >>>compatible with VB6. But you are saying that, "VB.Net's only
              >>>resemblanc e to the Visual Basic programming language is in name only"?
              >>>Are you sure you are correct about that? Presumably you have some
              >>>experience with vb.net programming? Is it your opinion that vb.net is
              >>>not compatible with VB6 after all? Bill McCarthy says that it is, and I
              >>>have been relying on his advice.
              >>>
              >>What Bill writes is very true, the languages VB7, VB7.1 VB8 and VB9 are
              >>almost completely upwards compatible with VB6.
              >>>
              >>However the tool Visual Basic '98 (1998) is very much different, this
              >>tool was in fact for Com (as there was no Net).
              >>>
              >>The tools after Visual Basic 1998 (numbered 2002, 2003 2005 and 2008
              >>with different versions) were made for Net, while it is still possible
              >>to use Com. However most classes which are delivered with Visual Basic
              >>'98 are in the latter version im the Microsoft Visual Basic compatible
              >>namespace, which is not like the Microsoft.Visua lBasic namespace an
              >>official namespace from Net and probably will disapear in future. The
              >>latter is also very bad to handle in Visual Studio version behind the
              >>start of this millenium, while some classes are not even in that, by
              >>instance the FlexGrid, which is a crime to use in Visual Studio
              >>2002-2008
              >>>
              >>So as you write that the program language VB6 is not compatible with
              >>VB.Net then you are comparing apples and pears (Nothing wrong with that
              >>because that is the way it is mostly incorrect written, including by
              >>me).
              >>>
              >>The tool Visual Basic '98 is not compatible with the Visual Studio Tools
              >>behind that, however all VB program language versions are very much
              >>upwards compatible with all VB versions AFAIK starting at VB1.
              >>>
              >>I hope this clears your misunderstandin g a little bit. However Bill is
              >>in my opinion right with his statement.
              >>>
              >>Cor
              >>>
              >>>
              >>
              >

              Comment

              • Cor Ligthert[MVP]

                #8
                Re: Re: Moving character Glyphs

                Sorry,

                You are right, that what I wrote in my last reply about was the tool
                including C++, there were as well more limited versions.

                Cor

                "Cor Ligthert[MVP]" <notmyfirstname @planet.nlschre ef in bericht
                news:427AD3EE-43A3-46AA-A2CD-1F9AA1E2BAB6@mi crosoft.com...
                Correction, the name of the tool was not Visual Basic 98 however Visual
                Studio 6 (not VB6)
                >
                Cor
                >
                "Cor Ligthert[MVP]" <notmyfirstname @planet.nlschre ef in bericht
                news:971F5330-9FC2-4A1C-A362-995A421A851A@mi crosoft.com...
                >Mike,
                >>
                >>That's very strange. I am a VB6 programmer looking for somewhere to move
                >>to and I am being told by a few people, specifically someone called Bill
                >>McCarthy on this very newsgroup, that vb.net is indeed compatible with
                >>VB6. But you are saying that, "VB.Net's only resemblance to the Visual
                >>Basic programming language is in name only"? Are you sure you are
                >>correct about that? Presumably you have some experience with vb.net
                >>programming ? Is it your opinion that vb.net is not compatible with VB6
                >>after all? Bill McCarthy says that it is, and I have been relying on his
                >>advice.
                >>
                >What Bill writes is very true, the languages VB7, VB7.1 VB8 and VB9 are
                >almost completely upwards compatible with VB6.
                >>
                >However the tool Visual Basic '98 (1998) is very much different, this
                >tool was in fact for Com (as there was no Net).
                >>
                >The tools after Visual Basic 1998 (numbered 2002, 2003 2005 and 2008
                >with different versions) were made for Net, while it is still possible to
                >use Com. However most classes which are delivered with Visual Basic '98
                >are in the latter version im the Microsoft Visual Basic compatible
                >namespace, which is not like the Microsoft.Visua lBasic namespace an
                >official namespace from Net and probably will disapear in future. The
                >latter is also very bad to handle in Visual Studio version behind the
                >start of this millenium, while some classes are not even in that, by
                >instance the FlexGrid, which is a crime to use in Visual Studio 2002-2008
                >>
                >So as you write that the program language VB6 is not compatible with
                >VB.Net then you are comparing apples and pears (Nothing wrong with that
                >because that is the way it is mostly incorrect written, including by me).
                >>
                >The tool Visual Basic '98 is not compatible with the Visual Studio Tools
                >behind that, however all VB program language versions are very much
                >upwards compatible with all VB versions AFAIK starting at VB1.
                >>
                >I hope this clears your misunderstandin g a little bit. However Bill is in
                >my opinion right with his statement.
                >>
                >Cor
                >>
                >>
                >

                Comment

                • =?Utf-8?B?TWFyaw==?=

                  #9
                  Re: Moving character Glyphs

                  Mike:
                  Please forgive me for that comment. I have used VB6 for quite awhile and
                  what I once could do easily in VB6 has now been complicated by VB.NET and the
                  dotnet framework.

                  --Mark


                  "Mike Williams" wrote:
                  "Mark" <Mark@discussio ns.microsoft.co mwrote in message
                  news:F9906801-F032-4B21-8E86-ACB403DE7C70@mi crosoft.com...
                  >
                  I modified a C# application from Bob Powell that moves graphics
                  primitives around on the screen into a Vb.NET 2005 application.
                  I want to modify this application so along with moving regular
                  geometric shapes, I can also move the alphanumeric characters as
                  well. Since I learn best by example I wrote another class for the
                  Characters, but it doesn't work. I asked Bob Powell and he
                  suggested I convert the characters to glyphs and hit test these,
                  but since VB.NET's only resembalance to the Visual Basic
                  programming language is in name only I'm now completely lost.
                  >
                  That's very strange. I am a VB6 programmer looking for somewhere to move to
                  and I am being told by a few people, specifically someone called Bill
                  McCarthy on this very newsgroup, that vb.net is indeed compatible with VB6.
                  But you are saying that, "VB.Net's only resemblance to the Visual Basic
                  programming language is in name only"? Are you sure you are correct about
                  that? Presumably you have some experience with vb.net programming? Is it
                  your opinion that vb.net is not compatible with VB6 after all? Bill McCarthy
                  says that it is, and I have been relying on his advice.
                  >
                  Mike
                  >
                  >
                  >
                  >

                  Comment

                  • =?Utf-8?B?TWFyaw==?=

                    #10
                    Re: Moving character Glyphs

                    Cor:
                    I did write Bob Powell. HE was the one who suggested using glyphs. What I
                    don't understand is how I get VB.NET to recongnize that the character I'm
                    pointing too is a glyph. All fonts are basically glyphs, so if I point to a
                    character glyph I should be able to hit test it.
                    --
                    Mark


                    "Cor Ligthert[MVP]" wrote:
                    Mark,
                    >
                    Drawing is typical Bob. So your only hope is that he sees this, or that you
                    mail him on his home page.
                    >
                    At first sight I don't see any trouble in your code, but you can test it
                    yourself better by setting a breakpoint and than see what happens.
                    >

                    >
                    I see he has still his old website (very old MVP logo) so I don't know of
                    the email is valid.
                    >
                    Cor
                    >
                    "Mark" <Mark@discussio ns.microsoft.co mschreef in bericht
                    news:F9906801-F032-4B21-8E86-ACB403DE7C70@mi crosoft.com...
                    I modified a C# application from Bob Powell that moves graphics primitives
                    around on the screen into a Vb.NET 2005 application. I want to modify this
                    application so along with moving regular geometric shapes, I can also move
                    the alphanumeric characters as well. For example I place the character "A"
                    on
                    the screen and when I point to it with the mouse the character will be
                    outlined and while holding down the left mouse button move the "A"
                    somewhere
                    else on the screen.

                    Since I learn best by example I wrote another class for the Characters,
                    but
                    it doesn't work. I asked Bob Powell and he suggested I convert the
                    characters
                    to glyphs and hit test these, but since VB.NET's only resembalance to the
                    Visual Basic programming language is in name only I'm now completely lost.

                    Here is the Class I wrote:
                    Public Class DrawText
                    Inherits Primitive

                    Public Sub New()
                    MyBase.New()
                    End Sub

                    Public Overloads Overrides Sub Draw(ByVal g As Graphics)
                    Dim b As New SolidBrush(Me.C olor)
                    Dim txt As String = "Aa"
                    'Dim big_font As New Font("Times New Roman", 30,
                    FontStyle.Bold)
                    'g.TextRenderin gHint =
                    Drawing.Text.Te xtRenderingHint .AntiAliasGridF it
                    'g.DrawString(t xt, big_font, Brushes.Black, 10, 100)

                    'g.FillRectangl e(b, New Rectangle(Me.Lo cation, Me.Size))
                    'b.Dispose()

                    'Create a GraphicsPath
                    Dim graphics_path As New Drawing2D.Graph icsPath
                    'Add some text to the path
                    graphics_path.A ddString(txt, _
                    New FontFamily("Tim es New Roman"), _
                    CInt(FontStyle. Bold), _
                    80, New Point(10, 100), _
                    StringFormat.Ge nericTypographi c)

                    g.SmoothingMode = Drawing2D.Smoot hingMode.AntiAl ias
                    g.FillPath(Brus hes.White, graphics_path)
                    g.DrawPath(New Pen(Drawing.Col or.Black, 3), graphics_path)
                    b.Dispose()
                    If Highlight Then
                    Dim p As New Pen(Drawing.Col or.Red, 3)
                    p.DashStyle = Drawing2D.DashS tyle.DashDot
                    g.DrawRectangle (p, New Rectangle(Me.Lo cation, Me.Size))
                    p.Dispose()
                    End If
                    End Sub

                    Public Overloads Overrides Function HitTest(ByVal p As Point) As
                    Boolean
                    Dim pth As New Drawing2D.Graph icsPath()
                    pth.AddEllipse( New Rectangle(Locat ion, Size))
                    Dim retval As Boolean = pth.IsVisible(p )
                    pth.Dispose()
                    Return retval
                    End Function
                    End Class

                    Can someone tell me what I'm doing wrong?
                    --
                    Mark
                    >

                    Comment

                    • Bill McCarthy

                      #11
                      Re: Moving character Glyphs

                      Post the code you would use in VB6


                      "Mark" <Mark@discussio ns.microsoft.co mwrote in message
                      news:39887118-6EDA-4E0F-A3FE-A6E2CBA9DF3A@mi crosoft.com...
                      Mike:
                      Please forgive me for that comment. I have used VB6 for quite awhile and
                      what I once could do easily in VB6 has now been complicated by VB.NET and
                      the
                      dotnet framework.
                      >
                      --Mark
                      >
                      >
                      "Mike Williams" wrote:
                      >
                      >"Mark" <Mark@discussio ns.microsoft.co mwrote in message
                      >news:F990680 1-F032-4B21-8E86-ACB403DE7C70@mi crosoft.com...
                      >>
                      I modified a C# application from Bob Powell that moves graphics
                      primitives around on the screen into a Vb.NET 2005 application.
                      I want to modify this application so along with moving regular
                      geometric shapes, I can also move the alphanumeric characters as
                      well. Since I learn best by example I wrote another class for the
                      Characters, but it doesn't work. I asked Bob Powell and he
                      suggested I convert the characters to glyphs and hit test these,
                      but since VB.NET's only resembalance to the Visual Basic
                      programming language is in name only I'm now completely lost.
                      >>
                      >That's very strange. I am a VB6 programmer looking for somewhere to move
                      >to
                      >and I am being told by a few people, specifically someone called Bill
                      >McCarthy on this very newsgroup, that vb.net is indeed compatible with
                      >VB6.
                      >But you are saying that, "VB.Net's only resemblance to the Visual Basic
                      >programming language is in name only"? Are you sure you are correct about
                      >that? Presumably you have some experience with vb.net programming? Is it
                      >your opinion that vb.net is not compatible with VB6 after all? Bill
                      >McCarthy
                      >says that it is, and I have been relying on his advice.
                      >>
                      >Mike
                      >>
                      >>
                      >>
                      >>

                      Comment

                      • Cor Ligthert[MVP]

                        #12
                        Re: Moving character Glyphs

                        Mark,

                        As Bob not can tell you this, I am for sure not the best in helping you
                        with this.
                        Drawing is absolute not my favorite part of programming.

                        I only wanted you to supply the link to Bob his homepage.

                        Sorry,

                        Cor


                        "Mark" <Mark@discussio ns.microsoft.co mschreef in bericht
                        news:D0E3D567-2E2F-40F2-A40F-F8BB937479D4@mi crosoft.com...
                        Cor:
                        I did write Bob Powell. HE was the one who suggested using glyphs. What I
                        don't understand is how I get VB.NET to recongnize that the character I'm
                        pointing too is a glyph. All fonts are basically glyphs, so if I point to
                        a
                        character glyph I should be able to hit test it.
                        --
                        Mark
                        >
                        >
                        "Cor Ligthert[MVP]" wrote:
                        >
                        >Mark,
                        >>
                        >Drawing is typical Bob. So your only hope is that he sees this, or that
                        >you
                        >mail him on his home page.
                        >>
                        >At first sight I don't see any trouble in your code, but you can test it
                        >yourself better by setting a breakpoint and than see what happens.
                        >>
                        >http://www.bobpowell.net/
                        >>
                        >I see he has still his old website (very old MVP logo) so I don't know of
                        >the email is valid.
                        >>
                        >Cor
                        >>
                        >"Mark" <Mark@discussio ns.microsoft.co mschreef in bericht
                        >news:F990680 1-F032-4B21-8E86-ACB403DE7C70@mi crosoft.com...
                        >I modified a C# application from Bob Powell that moves graphics
                        >primitives
                        around on the screen into a Vb.NET 2005 application. I want to modify
                        this
                        application so along with moving regular geometric shapes, I can also
                        move
                        the alphanumeric characters as well. For example I place the character
                        "A"
                        on
                        the screen and when I point to it with the mouse the character will be
                        outlined and while holding down the left mouse button move the "A"
                        somewhere
                        else on the screen.
                        >
                        Since I learn best by example I wrote another class for the Characters,
                        but
                        it doesn't work. I asked Bob Powell and he suggested I convert the
                        characters
                        to glyphs and hit test these, but since VB.NET's only resembalance to
                        the
                        Visual Basic programming language is in name only I'm now completely
                        lost.
                        >
                        Here is the Class I wrote:
                        Public Class DrawText
                        Inherits Primitive
                        >
                        Public Sub New()
                        MyBase.New()
                        End Sub
                        >
                        Public Overloads Overrides Sub Draw(ByVal g As Graphics)
                        Dim b As New SolidBrush(Me.C olor)
                        Dim txt As String = "Aa"
                        'Dim big_font As New Font("Times New Roman", 30,
                        FontStyle.Bold)
                        'g.TextRenderin gHint =
                        Drawing.Text.Te xtRenderingHint .AntiAliasGridF it
                        'g.DrawString(t xt, big_font, Brushes.Black, 10, 100)
                        >
                        'g.FillRectangl e(b, New Rectangle(Me.Lo cation, Me.Size))
                        'b.Dispose()
                        >
                        'Create a GraphicsPath
                        Dim graphics_path As New Drawing2D.Graph icsPath
                        'Add some text to the path
                        graphics_path.A ddString(txt, _
                        New FontFamily("Tim es New Roman"), _
                        CInt(FontStyle. Bold), _
                        80, New Point(10, 100), _
                        StringFormat.Ge nericTypographi c)
                        >
                        g.SmoothingMode = Drawing2D.Smoot hingMode.AntiAl ias
                        g.FillPath(Brus hes.White, graphics_path)
                        g.DrawPath(New Pen(Drawing.Col or.Black, 3), graphics_path)
                        b.Dispose()
                        If Highlight Then
                        Dim p As New Pen(Drawing.Col or.Red, 3)
                        p.DashStyle = Drawing2D.DashS tyle.DashDot
                        g.DrawRectangle (p, New Rectangle(Me.Lo cation, Me.Size))
                        p.Dispose()
                        End If
                        End Sub
                        >
                        Public Overloads Overrides Function HitTest(ByVal p As Point) As
                        Boolean
                        Dim pth As New Drawing2D.Graph icsPath()
                        pth.AddEllipse( New Rectangle(Locat ion, Size))
                        Dim retval As Boolean = pth.IsVisible(p )
                        pth.Dispose()
                        Return retval
                        End Function
                        End Class
                        >
                        Can someone tell me what I'm doing wrong?
                        --
                        Mark
                        >>

                        Comment

                        • Al Reid

                          #13
                          Re: Moving character Glyphs



                          --
                          Al Reid
                          "Mike Williams" <mikea@whiskyan dCoke.comwrote in message news:uWPVA4osIH A.3564@TK2MSFTN GP03.phx.gbl...
                          "Mark" <Mark@discussio ns.microsoft.co mwrote in message
                          news:F9906801-F032-4B21-8E86-ACB403DE7C70@mi crosoft.com...
                          >
                          I modified a C# application from Bob Powell that moves graphics
                          primitives around on the screen into a Vb.NET 2005 application.
                          I want to modify this application so along with moving regular
                          geometric shapes, I can also move the alphanumeric characters as
                          well. Since I learn best by example I wrote another class for the
                          Characters, but it doesn't work. I asked Bob Powell and he
                          suggested I convert the characters to glyphs and hit test these,
                          but since VB.NET's only resembalance to the Visual Basic
                          programming language is in name only I'm now completely lost.
                          >
                          That's very strange. I am a VB6 programmer looking for somewhere to move to
                          and I am being told by a few people, specifically someone called Bill
                          McCarthy on this very newsgroup, that vb.net is indeed compatible with VB6.
                          But you are saying that, "VB.Net's only resemblance to the Visual Basic
                          programming language is in name only"? Are you sure you are correct about
                          that? Presumably you have some experience with vb.net programming? Is it
                          your opinion that vb.net is not compatible with VB6 after all? Bill McCarthy
                          says that it is, and I have been relying on his advice.
                          >
                          Mike
                          >
                          Vb.Net and VB6 are so similar that I find that switching between development on either one several times a day is easy, simple and
                          painless. The language/syntax is, for the most part, identical. It's just a matter of learning the .Net Framework.

                          YMMV
                          --
                          Al Reid


                          Comment

                          Working...