Results 1 to 6 of 6
  1. #1
    Geometrical's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Location
    In the middle of nowhere.
    Posts
    1,034
    Reputation
    331
    Thanks
    10,335
    My Mood
    Chatty

    Lightbulb Drawing a simple & neat crosshair on screen

    This is one of the easiest methods to overlay the screen and the fastest. I don't know if you can use it in games, I haven't tried it (I don't have any games ).



    ●First start of by creating some variables
    Code:
    Private PenColor As Pen = Pens.Blue 'The pen to use when drawing the crosshair.
    Private Diameter As Integer = 250 'The diameter of the outer circle.
    Private DrawMidPoint As Boolean = False 'Weather or not to draw the mid point for better accuracy.
    Private ScreenSize As Size = Screen.PrimaryScreen.Bounds.Size
    ●Now we change some of the form properties. You'll need to change the size of the form dynamically however (to the bounds of the screen) if you want it to work for everyone.
    Code:
    With Me
        .StartPosition = FormStartPosition.Manual
        .Location = New Point(0, 0)
        .FormBorderStyle = BorderStyle.None
        .Size = New Size(ScreenSize.Width, ScreenSize.Height)
        .WindowState = FormWindowState.Maximized
        .Text = "External Crosshair"
        .TopMost = True
        .BackColor = Color.White
        .TransparencyKey = .BackColor
        .Icon = SystemIcons.Application
    End With
    ●And now to actually draw the crosshair using the 'paint' form event. I'm not really sure about the measurements which I have done, the crosshair may not be exactly it in the center. So you can make some minor adjust
    Code:
    Private Sub OverlayPaint(ByVal sender As System.Object, ByVal e As PaintEventArgs) Handles Me.Paint
        e.Graphics.DrawArc(PenColor, New Rectangle(New Point((e.ClipRectangle.Size.Width / 2) - (Diameter / 2), (e.ClipRectangle.Size.Height / 2) - (Diameter / 2)), New Size(Diameters, Diameter)), 0, 360)
        If DrawMidPoint = True Then
            e.Graphics.DrawArc(PenColor, New Rectangle(New Point((e.ClipRectangle.Size.Width / 2) - (10 / 2), (e.ClipRectangle.Size.Height / 2) - (10 / 2)), New Size(10, 10)), 0, 360)
        End If
        e.Graphics.Dispose()
    End Sub
    ●You can change the variables at any time, but remember to redraw the graphics once you have done so using the 'refresh' function.

    You may be wondering why couldn't we just get a handle to the screen and directly draw on it?, but I've already tried it and it will NOT work out. The windows screen rendering overides your graphics once the controls has changed. So you'll have to keep drawing it over and over which is really laggy.
    Last edited by Geometrical; 12-21-2013 at 08:13 PM.

  2. #2
    viniciuscbb's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    0
    Erro Diameter is not declared
    ?

  3. #3
    Geometrical's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Location
    In the middle of nowhere.
    Posts
    1,034
    Reputation
    331
    Thanks
    10,335
    My Mood
    Chatty
    Quote Originally Posted by viniciuscbb View Post
    Erro Diameter is not declared
    ?
    Edit: change 'Radius' to 'Diameter' in the variables.

    My bad

  4. #4
    leejw29's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    221
    Reputation
    10
    Thanks
    2,756
    This doesn't work if the game is in fullscreen mode right? Only 'windowed' games /:

  5. #5
    Geometrical's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Location
    In the middle of nowhere.
    Posts
    1,034
    Reputation
    331
    Thanks
    10,335
    My Mood
    Chatty
    Quote Originally Posted by leejw29 View Post
    This doesn't work if the game is in fullscreen mode right? Only 'windowed' games /:
    That's not for certain, didn't try.

  6. #6
    thijsy0's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    I tried it like this too but you will be able to click/right-click the lines so you wouldnt shoot/aim in-game. Do you know how to fix this?

Similar Threads

  1. [Help Request] How to draw crosshair in the center of the screen?
    By incubeftw in forum C++/C Programming
    Replies: 16
    Last Post: 08-18-2013, 12:50 PM
  2. [Release] Simple Prototype Alex Mercer Login Screen
    By Xultimate29X in forum CrossFire Mods & Rez Modding
    Replies: 13
    Last Post: 03-02-2013, 08:29 AM
  3. Simple Prototype Alex Mercer Login Screen
    By Xultimate29X in forum CrossFire PH Mods & Rez Modding
    Replies: 6
    Last Post: 02-25-2013, 05:49 AM
  4. [Request] Simple Crosshair Overlay on Screen - For Windowed Mode
    By chaosfaction in forum Battlefield 3 (BF3) Hacks & Cheats
    Replies: 4
    Last Post: 08-06-2012, 10:36 PM
  5. SIMPLE CHAMS CROSSHAIR NOT WOrKING
    By zekeria in forum Combat Arms Hacks & Cheats
    Replies: 6
    Last Post: 03-03-2009, 05:50 PM