Jump to content

bmp jpg gif png tif interconverter dll?


iZafiro
 Share

Recommended Posts

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
Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 2 months later...

Oh, I've found a bmp to png dll! It's here at http://windapple.gmxhome.de/ImageConversion.zip.

I really can't get it to work... can any dll expert here help?

I'm trying to understand what's in the gc file that can be opened by notepad....

And here it is (bmp2png convert):

$convertor = DllOpen("ImageConversion.dll")
DllCall($convertor, "int:cdecl", "bmppngconvert", "str", "input.bmp", "str","output.png")
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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