Jump to content

Recommended Posts

Posted

Hi. I have made a little screenshot program with captdll.dll (THANKS LAZYCAT! http://www.autoitscript.com/forum/index.ph...amp;hl=captdll)

It works great, with jpg and bmp support, but I would like to have gif, png and tif support too.

I guess the easier way would be to get a converter dll between all five and convert.

However, I have been searching the web for the past few hours and still can't find one...

Any help? Or is there any inbuilt function I missed?

(Oh and are there seperate dll's on the respective official websites?)

Thanks in advance: here's my screenshot part:

;$camtype is the ControlID of a GUICombo with the selections: ".jpg|.bmp"
;$camquality is the ControlID of a GUIInput
;$name is the ControlID of a GUIInput
;$dir is  the ControlID of a GUICombo with the selections: "Desktop|My Docs|My Pics|Hard Disk"

HotKeySet("{PRINTSCREEN}","CamInit")
HotKeySet("{ESC}", "Terminate")

$camnumber = 0
$camformat = ""
$file = ""

Func CamInit()
    If $x = 0 Then
        $x = 5
        If GUICtrlRead($camquality) > 100 OR GUICtrlRead($camquality) < 1 Then
            MsgBox("0", "Error", "The JPEG quality only ranges from 1 - 100!")
        Else
            Camera()
        EndIf
    EndIf
EndFunc

Func Camera()
    If GUICtrlRead($camtype) = ".bmp" Then
        $camformat = "-1"
    ElseIf GUICtrlRead($camtype) = ".jpg" Then
        $camformat = GUICtrlRead($camquality)
    EndIf
    Select
        Case GUICtrlRead($dir) = "Desktop"
            $file = @DesktopDir & "\"
        Case GUICtrlRead($dir) = "My Docs"
            $file = @MyDocumentsDir & "\"
        Case GUICtrlRead($dir) = "My Pics"
            $file = @MyDocumentsDir & "\My Pictures\"
        Case GUICtrlRead($dir) = "Hard Disk"
            $file = @HomeDrive & ":\"
    EndSelect
    If FileExists($file & GUICtrlRead($dir2) & GUICtrlRead($name) & $camnumber & GUICtrlRead($camtype)) Then
        Do
            $camnumber += 1
        Until NOT FileExists($file & GUICtrlRead($dir2) & GUICtrlRead($name) & $camnumber & GUICtrlRead($camtype))
    EndIf
    If NOT FileExists($file & GUICtrlRead($dir2)) Then
        DirCreate($file & GUICtrlRead($dir2))
    EndIf
    $camfile = $file & GUICtrlRead($dir2) & GUICtrlRead($name) & $camnumber & GUICtrlRead($camtype)
    DllCall("captdll.dll", "int", "CaptureScreen", "str", $camfile, "int", $camformat)
    GUICtrlSetData($status,"Screenshot taken")
    $x = 0
    $camnumber = 0
EndFunc

Func Terminate()
    Exit
EndFunc
Posted

I don´t know any dll to do that. But you still use IrFanView command line mode to fit all your needs...

You don´t have to install IrFanView in your computer only the main executable is needed and it can be included in your proyect with FileInstall...

Read IrFanView help file for more info about command line...

Hope that helps :)

Posted (edited)

Hmm, works okay, but increases my total program size by about 170% !!! :D

Maybe I can extract the conversion dll's in IrfanView to use in my program, I think that would be smaller...

Or maybe there's a download page on their forum? :)

Checking now..... :D

EDIT: Argh! There were no png gif jpg bmp tif dll's in the IrfanView directory in the first place.

Stupid me....

:party::P

Edited by iZafiro
Posted

Wow! You mean PictView allows people to download their dll's with sample codes?????

I can't wait to try it! *brush my teeth, bathe, eat my breakfast, grab a cup of coke, walk to the computer* Okay now I can start!

Yahoo! Wish me luck!

Posted

:D:party: When they gave examples in C++, I could only try to understand why they call dll functions with for example PVCloseImage(PVHandle) and not DllCall(something something) :party:

Any help?

:P:D:)

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...