ThePentiumGuy
Well-known member
hey i have this code: (got it from Darc)
[/color]
well,
heres how you use it
GetScreenCapture(True).Save(Application.StartupPath & "\ScreenShot.png")
thats the only way i know of to use it,
what happened to the FileName as String argument?
was it hidden text like my other post i made a while ago(actually, that one i fixed by restarting .net )
but this one seems to be permanent.
why is it that the STRING is optional but not the boolean?
pent
edit: and i can just delete the string argument in the function and itll work.. i never use FileName anyways im just wondering why it doesnt require me to enter the string
pent
Code:
[color=#0000ff]Public[/color] [color=#0000ff]Function[/color] GetScreenCapture([color=#0000ff]ByVal[/color] FileName [color=#0000ff]As[/color] [color=#0000ff]String[/color], [color=#0000ff]Optional[/color] [color=#0000ff]ByVal[/color] FullScreen [color=#0000ff]As[/color] [color=#0000ff]Boolean[/color] = [color=#0000ff]False[/color]) [color=#0000ff]As[/color] Image
[color=#008000] Captures the current screen and returns as an Image
[/color][color=#008000] object
[/color][color=#0000ff]Dim[/color] objSK [color=#0000ff]As[/color] SendKeys
[color=#0000ff]Dim[/color] imgCapture [color=#0000ff]As[/color] Image
[color=#0000ff]If[/color] FullScreen = [color=#0000ff]True[/color] [color=#0000ff]Then
[/color][color=#008000] Print Screen pressed twice here as some systems
[/color][color=#008000] grab active window "accidentally" on first run
[/color]objSK.SendWait("{PRTSC 2}")
[color=#0000ff]Else
[/color]objSK.SendWait("%{PRTSC}")
[color=#0000ff]End[/color] [color=#0000ff]If
[/color][color=#0000ff]Dim[/color] objData [color=#0000ff]As[/color] IDataObject = Clipboard.GetDataObject()
[color=#0000ff]Return[/color] [color=#0000ff]CType[/color](objData.GetData(DataFormats.Bitmap), Bitmap)
[color=#0000ff]End[/color] [color=#0000ff]Function[/color]
[color=#0000ff]
well,
heres how you use it
GetScreenCapture(True).Save(Application.StartupPath & "\ScreenShot.png")
thats the only way i know of to use it,
what happened to the FileName as String argument?
was it hidden text like my other post i made a while ago(actually, that one i fixed by restarting .net )
but this one seems to be permanent.
why is it that the STRING is optional but not the boolean?
pent
edit: and i can just delete the string argument in the function and itll work.. i never use FileName anyways im just wondering why it doesnt require me to enter the string
pent