Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › Drawing problems!

QuestionDrawing problems!

Posts 1–5 of 5 · Page 1 of 1
{B
{Banned}**HACKER**
Drawing problems!
Hello,
I was wondering if anyone has a solution to keep something drawn on my screen, I have kind of fixed it by just putting a Timer in my code and getting it to draw the image over and over but this causes lag and is a bit of a problem!
If i don't do that to keep the image on the screen, the image will show but as soon as something refreshes behind it the drawn image will be gone!
Is there anyway to keep the image drawn on the screen by not using a timer just to repeat the drawing process ?

Here is my whole code if this helps:
Code:
Public Class Form1
    Declare Function GetDC Lib "user32.dll" (ByVal hWnd As IntPtr) As System.IntPtr
    Declare Function ReleaseDC Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal hdc As IntPtr) As Integer

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim width As String = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width.ToString
        Dim height As String = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height.ToString
        Label1.Text = width
        Label2.Text = height
        Dim width2 As Integer = CInt(Label1.Text.ToString)
        Dim height2 As Integer = CInt(Label2.Text.ToString)
        Label1.Text = CStr(width2 / 2)
        Label2.Text = CStr(height2 / 2)
        Timer1.Start()
    End Sub
    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Dim width3 As Integer = Label1.Text
        Dim height3 As Integer = Label2.Text
            Dim hdc As IntPtr = GetDC(IntPtr.Zero)
            Dim gr As Graphics = Graphics.FromHdc(hdc)
        Dim Point As New Point(width3, height3)
        If RadioButton1.Checked = True Then
            gr.DrawImage(My.Resources.cross1, Point)
        ElseIf RadioButton2.Checked = True Then
            gr.DrawImage(My.Resources.cross2, Point)
        ElseIf RadioButton3.Checked = True Then
            gr.DrawImage(My.Resources.cross3, Point)
        End If
    End Sub

    Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
        If RadioButton1.Checked = True Then
            PictureBox1.Image = My.Resources.cross1
        End If
        If RadioButton2.Checked = True Then
            PictureBox1.Image = My.Resources.cross2
        ElseIf radiobutton3.checked = True Then
            PictureBox1.Image = My.Resources.cross3
        End If
    End Sub
End Class
Thanks in advance guys
#1 · 14y ago
Pingo
Pingo
Adding your code to the paint event should do the job.

I also wouldnt use that second timer either. You can handle all that just using Radiobutton checked changed.
Something like this should work
Code:
    Private Sub _CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, RadioButton2.CheckedChanged, radioButton3.CheckedChanged
        PictureBox1.Image = If(RadioButton1.Checked, My.Resources.cross1, If(RadioButton2.Checked, My.Resources.cross2, My.Resources.cross3))
    End Sub
#2 · 14y ago
{B
{Banned}**HACKER**
Thanks man, using paint event now and its working better anyway but still not perfect, and thanks for that code
#3 · 14y ago
Pingo
Pingo
np dude, i didnt try fixing the main function. I'll see if i can help you further so you can get the first part working the way you want.
I cant really tell whats wrong just by looking at it, im not a vb coder. So i'll create the code on my end to see what the problem is.

EDIT:
Looks like flicker. Not really sure how to fix that but i have another option.
Instead of drawing your image on screen, draw it on another form.

Example
Create another form in your project. I called mine Picures
Set the FormBorderStyle to None

Something like this can be used to change the settings
Code:
    Public Sub CreateImage(ByVal _Form As Form, ByVal _Size As Size, ByVal _Location As Point, ByVal _Image As Image)
        If Not _Form.Visible Then
            _Form.Show()
        End If
        _Form.Location = _Location
        _Form.Size = _Size
        _Form.BackgroundImage = _Image
        _Form.BackgroundImageLayout = ImageLayout.Stretch
    End Sub
ByVal _Form As Form = Second Form
ByVal _Size As Size = size you would like the image
ByVal _Location As Point = location on screen
ByVal _Image As Image = Image you want

On the same RadioButton Checked Changed
Code:
    Private Sub _CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, RadioButton2.CheckedChanged, RadioButton3.CheckedChanged
        Dim _Size As Size = Screen.PrimaryScreen.Bounds.Size
        Dim _Image As Image = If(RadioButton1.Checked, My.Resources.cross1, If(RadioButton2.Checked, My.Resources.cross2, My.Resources.cross3))
        CreateImage(Pictures, New Size(150, 150), New Point(_Size.Width / 2, _Size.Height / 2), _Image)
    End Sub
I only have the size 150x150 and some random location. But everytime i change radio button, the image changes without flicker.
Maybe have a mess around with it, might help ya.
#4 · edited 14y ago · 14y ago
{B
{Banned}**HACKER**
Hmm seems another good choice ill have to try this Thanks alot for your help
#5 · 14y ago
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

  • Drawing problems...By Mr.Magicman in Combat Arms Coding Help & Discussion
    8Last post 15y ago
  • [Help]Problem with Drawing + ValueBy HazXoD3D in Visual Basic Programming
    0Last post 16y ago
  • anyone else having this problem with instant draw?By akkuro in Combat Arms Mod Discussion
    6Last post 15y ago
  • WPE problem...By styx23 in General Game Hacking
    8Last post 20y ago
  • Problem Wit Hacking ProgramsBy f5awp in General Gaming
    5Last post 20y ago

Tags for this Thread

None