how can I reference this bitmap?????????

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marc

    #1

    how can I reference this bitmap?????????

    Guys the below code is not working ( i know i am trying to reference a
    function!) .

    Im a beginner so does anyone know how i could reference the bitmap?



    Private Sub MarkVORToolStri pMenuItem_Click (ByVal sender As
    System.Object, ByVal e As System.EventArg s) Handles
    MarkVORToolStri pMenuItem.Click
    If ContextMenuStri p1.SourceContro l.BackgroundIma ge Is
    DrawCross() Then
    msgbox("test")
    End Sub

    Friend Function DrawCross() As Bitmap
    Dim sampleBitmap As New Bitmap(32, 32)
    Dim g As Graphics = Graphics.FromIm age(sampleBitma p)
    Dim p As New Pen(Professiona lColors.ButtonP ressedBorder)
    p.Color = Color.Red
    Try
    p.Width = 2
    g.DrawLine(p, -35, 65, 80, -45)
    g.DrawLine(p, 200, 200, 0, 0)
    Finally
    p.Dispose()
    End Try
    Return sampleBitmap
    End Function

  • Herfried K. Wagner [MVP]

    #2
    Re: how can I reference this bitmap?????????

    "Marc" <marc_crosby@ho tmail.comschrie b:
    Guys the below code is not working ( i know i am trying to reference a
    function!) .
    >
    Im a beginner so does anyone know how i could reference the bitmap?
    \\\
    Private m_Cross As Bitmap

    Public Sub New()
    m_Cross = DrawCross()
    End Sub
    Private Sub MarkVORToolStri pMenuItem_Click (ByVal sender As
    System.Object, ByVal e As System.EventArg s) Handles
    MarkVORToolStri pMenuItem.Click
    If ContextMenuStri p1.SourceContro l.BackgroundIma ge Is
    DrawCross() Then
    Replace the line above with this:

    \\\
    If ContextMenuStri p1.SourceContro l.BackgroundIma ge Is m_Cross Then
    ...
    End If
    ///
    End Sub
    >
    Friend Function DrawCross() As Bitmap
    Dim sampleBitmap As New Bitmap(32, 32)
    [...]
    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    • Marc

      #3
      Re: how can I reference this bitmap?????????

      Thanks Herfried....

      your a star!


      Herfried K. Wagner [MVP] wrote:
      "Marc" <marc_crosby@ho tmail.comschrie b:
      Guys the below code is not working ( i know i am trying to reference a
      function!) .

      Im a beginner so does anyone know how i could reference the bitmap?
      >
      \\\
      Private m_Cross As Bitmap
      >
      Public Sub New()
      m_Cross = DrawCross()
      End Sub
      >
      Private Sub MarkVORToolStri pMenuItem_Click (ByVal sender As
      System.Object, ByVal e As System.EventArg s) Handles
      MarkVORToolStri pMenuItem.Click
      If ContextMenuStri p1.SourceContro l.BackgroundIma ge Is
      DrawCross() Then
      >
      Replace the line above with this:
      >
      \\\
      If ContextMenuStri p1.SourceContro l.BackgroundIma ge Is m_Cross Then
      ...
      End If
      ///
      >
      End Sub

      Friend Function DrawCross() As Bitmap
      Dim sampleBitmap As New Bitmap(32, 32)
      [...]
      >
      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: how can I reference this bitmap?????????

        "Marc" <marc_crosby@ho tmail.comschrie b:
        Thanks Herfried....
        >
        your a star!
        You are welcome!

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

        Comment

        Working...