[VB.NET] Need help with Screenshot taker menu

User Tag List

Results 1 to 2 of 2
  1. #1
    dididii's Avatar Private
    Reputation
    1
    Join Date
    Oct 2010
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [VB.NET] Need help with Screenshot taker

    Hi I am currently trying to create Screenshot taker, which saves the screen as for example bitmap and then saves it. The problem is that it only saves desktop while I want it to save whole screen (For example while in WoW with full screen it only saves desktop, I want it to save WoW screen). I have tried using APIs GetForegroundWindow etc but no success yet. Need some solution without use of SendKeys(alt+printscreen).

    Here's simple solution which only saves desktop (CopyFromScreen):
    Code:
    Dim ScreenSize As Size = New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
    Dim screenGrab As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
    Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(screenGrab)
    g.CopyFromScreen(New Point(0, 0), New Point(0, 0), ScreenSize)
    screenGrab.Save("C:\asd.jpg")
    Here's using GetForegroundWindow (still only desktop):
    Code:
    Private Declare Function GetForegroundWindow Lib "user32.dll" () As IntPtr
    
    Public Structure RECT
            Public Left As Integer
            Public Top As Integer
            Public Right As Integer
            Public Bottom As Integer
    End Structure
    
    Dim rct As RECT
    GetWindowRect(GetForegroundWindow(), rct)
    
    Using bmpScreenshot As Bitmap = New Bitmap(rct.Right - rct.Left, rct.Bottom - rct.Top, PixelFormat.Format24bppRgb)
           Using gfxScreenshot As Graphics = Graphics.FromImage(bmpScreenshot)
                  gfxScreenshot.CopyFromScreen(rct.Left, rct.Top, 0, 0, New Size(rct.Right - rct.Left, rct.Bottom - rct.Top), CopyPixelOperation.SourceCopy)
           End Using
           PictureBox1.Image = New Bitmap(bmpScreenshot)
           bmpScreenshot.Save("C:\asd.jpg", ImageFormat.Jpeg)
    End Using
    Thanks.

    [VB.NET] Need help with Screenshot taker
  2. #2
    Steveiwonder's Avatar Active Member
    Reputation
    31
    Join Date
    Oct 2009
    Posts
    122
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is from my C# App, this is the only thing different and it works fine.

    gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Y, 0,0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy)

    I don't know if it will fix yours but should

    Steve

Similar Threads

  1. Need help with my B-Net/SoR Acc.
    By Hanfidanfi in forum World of Warcraft General
    Replies: 15
    Last Post: 07-01-2013, 01:50 PM
  2. Need help with weapon model edit!
    By Chewbbaca in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 09-20-2006, 07:02 PM
  3. need help with model editing experts please
    By sportstud10124 in forum Community Chat
    Replies: 0
    Last Post: 08-10-2006, 09:30 PM
  4. need help with shammy talents
    By jason in forum World of Warcraft General
    Replies: 5
    Last Post: 07-19-2006, 02:02 AM
  5. Need Help with WoW Glider
    By paypal in forum World of Warcraft General
    Replies: 2
    Last Post: 07-07-2006, 02:08 AM
All times are GMT -5. The time now is 03:58 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search