First things first, I don't know shit about VB.NET, so if some of this cannot be converted from C#, I apologize.
To use BlackMagic, you need to instantiate a new BlackMagic class object. Magic.BlackMagic bm = new Magic.BlackMagic
From there, you can use its static methods to find the window or process of Wow.exe and open it, thus: bm.Open(SProcess.GetProcessFromProcessName("wow"))
Now you can use bm.ReadUInt(Address) and the like to read from memory.
If you're using GDI+, you're going to want to render your radar onto a panel control, so add one to your form and call it whatever you want; I called mine panelRadar.
Use the System.Runtime.InteropServices namespace to import user32.PeekMessage, like so:
<DllImport("User32.dll")> _
Public Shared Function PeekMessage(<Out> ByRef msg As Message, ByVal hWnd As IntPtr, ByVal messageFilterMin As UInt32, ByVal messageFilterMax As UInt32, ByVal flags As UInt32) As Boolean
In your form constructor, the one where it calls InitializeComponent();, set up a new event handler for the Application.Idle event. AddHandler Application.Idle, New EventHandler(AddressOf Me.Application_Idle)
Code:
Private brush As Brush
Private font As Font
Private fps As Single = 30!
Private img As Image
Private lastTick As Integer
Public Sub New()
AddHandler Application.Idle, New EventHandler(AddressOf Me.Application_Idle)
Me.InitializeComponent
Me.brush = New SolidBrush(Color.White)
Me.pen = New Pen(Color.White, 2!)
Me.font = New Font(FontFamily.GenericSansSerif, 8!)
Me.img = New Bitmap(Me.panelRadar.Width, Me.panelRadar.Height)
Me.DoubleBuffered = True
Try
Me.bm = New BlackMagic
Catch ex As Exception
MessageBox.Show(ex.Message)
MyBase.Close
End Try
End Sub
Private Sub Application_Idle(ByVal sender As Object, ByVal e As EventArgs)
Dim msg As Message
Dim g As Graphics = panelRadar.CreateGraphics
Do While Not frmMain.PeekMessage(msg, IntPtr.Zero, 0, 0, 0)
If ((Environment.TickCount - Me.lastTick) > CInt((1000! / Me.fps))) Then
Me.lastTick = Environment.TickCount
Me.Render(g, Me.img)
Else
Thread.Sleep(1)
End If
Loop
g.Dispose
End Sub
Private Sub Render(ByVal renderer As Graphics, ByVal img As Image)
'//refresh all object location and shit here
Dim size As Size = Me.panelRadar.Size
Dim g As Graphics = Graphics.FromImage(img)
g.Clear(Color.Black)
g.SmoothingMode = SmoothingMode.HighQuality
Dim obj As WoWObject
For Each obj In Me.Objects '//Me.Objects should be a list of all currently loaded objects
Me.DrawObject(Me.LocalPlayer, obj, size, g, Me.pen, Me.brush, Me.font)
Next
renderer.DrawImageUnscaled(img, 0, 0)
g.Dispose
End Sub
Private Sub DrawObject(ByVal player As WoWObject, ByVal obj As WoWObject, ByVal size As Size, ByVal g As Graphics, ByVal p As Pen, ByVal b As Brush, ByVal font As Font)
Try
obj.RefreshPosition
Dim pos As New RectangleF
pos.X = ((-player.Position.X + obj.Position.X) + ((size.Width / 2) - 3))
pos.Y = ((player.Position.Z - obj.Position.Z) + ((size.Height / 2) - 3))
pos.Width = 6!
pos.Height = 6!
g.TranslateTransform((-pos.X - 3!), (-pos.Y - 3!), MatrixOrder.Append)
g.RotateTransform(obj.Rotation, MatrixOrder.Append) '//obj.Rotation should be in degrees, not radians
g.TranslateTransform((pos.X + 3!), (pos.Y + 3!), MatrixOrder.Append)
g.DrawEllipse(p, pos)
g.DrawLine(p, (pos.X + 3!), pos.Y, (pos.X + 3!), (pos.Y - 6!))
g.ResetTransform
g.DrawString(obj.Name, font, b, CSng((pos.X + 3!)), CSng((pos.Y + 6!)))
Catch obj1 As Object
End Try
End Sub
A lot of this you will probably change with your own code, like how you store objects and their locations and rotation, but this is, as far as I can tell, the correct way to use GDI+ to draw on a panel control. Do not use Me.Invalidate() and override the OnPaint method; that is a terrible way of forcing redraw.
You should also set an event handler for panelRadar.OnResize that will dispose of the current Me.img and create a new Bitmap object that is the new size of panelRadar.
Hopefully it helps. You should be able to find everything else you need, like iterating through loaded objects and getting their positional information, on these forums.
Final disclaimer: I used .NET Reflector to convert code I had written for a radar program for a different game (Runes of Magic) from C# to VB.NET. If something is wrong or stupid, it's not my fault; I don't know anything about VB.NET.