Results 1 to 6 of 6
  1. #1
    ThreadOP's Avatar
    Join Date
    Jul 2014
    Gender
    female
    Posts
    23
    Reputation
    10
    Thanks
    91

    .Gif Recorder (Easily create .GIF animations)

    Inspired by the corruption of Gayzo which does not allow you to use their tool after reaching maximum amount of storage on their site. I created this here .gif recorder in the .NET framework (4.0 for XP).

    Basically all you do is press ALT+A to start recording and ALT+S to stop & save the recording(gif).

    When I'm done I'll release the source and create tutorial on it, and I might create a Upload feature. I did have a IMGUR Api, however IMGur doesn't take .gifs, and sites that do take .gifs do not take ones that are too large or too long.



    Features?

    Gif "compiler", Compiles .PNG(s) into .GIF format

    Code:
        Public Sub createGif(ByVal Filename As String)
            Try
                Dim Encoder As New System.Windows.Media.Imaging.GifBitmapEncoder
                Dim imageList As New List(Of IO.FileStream)
                For Each imageFile As String In My.Computer.FileSystem.GetFiles(SavePath, FileIO.SearchOption.SearchTopLevelOnly, "*.png")
                    Dim fileStream1 As New IO.FileStream(imageFile, IO.FileMode.Open)
                    Dim createFrames = System.Windows.Media.Imaging.BitmapFrame.Create(fileStream1)
                    imageList.Add(fileStream1)
                    Encoder.Frames.Add(createFrames)
                Next
                Dim fileStream2 As New IO.FileStream(Filename, IO.FileMode.OpenOrCreate)
                Encoder.Save(fileStream2)
                fileStream2.Close()
                For Each f As IO.FileStream In imageList
                    f.Close()
                Next
            Catch ex As Exception
            End Try
            Try : System****.Directory.Delete(SavePath, True) : Catch : End Try
    end sub
    Code:
    Imports System
    Imports System.Runtime.InteropServices
    Imports System.Drawing
    Imports System.Drawing.Imaging
    Namespace ScreenShot
        '/ Provides functions to capture the entire screen, or a particular window, and save it to a file.
        Public Class ScreenCapture
            '/ Creates an Image object containing a screen shot of the entire desktop
            Public Function CaptureScreen() As Image
                Return CaptureWindow(User32.GetDesktopWindow())
            End Function 'CaptureScreen
            '/ Creates an Image object containing a screen shot of a specific window
            Public Function CaptureWindow(ByVal handle As IntPtr) As Image
                Dim SRCCOPY As Integer = &HCC0020
                ' get te hDC of the target window
                Dim hdcSrc As IntPtr = User32.GetWindowDC(handle)
                ' get the size
                Dim windowRect As New User32.RECT
                User32.GetWindowRect(handle, windowRect)
                Dim width As Integer = windowRect.right - windowRect.left
                Dim height As Integer = windowRect.bottom - windowRect.top
                ' create a device context we can copy to
                Dim hdcDest As IntPtr = GDI32.CreateCompatibleDC(hdcSrc)
                ' create a bitmap we can copy it to,
                ' using GetDeviceCaps to get the width/height
                Dim hBitmap As IntPtr = GDI32.CreateCompatibleBitmap(hdcSrc, width, height)
                ' select the bitmap object
                Dim hOld As IntPtr = GDI32.SelectObject(hdcDest, hBitmap)
                ' bitblt over
                GDI32.BitBlt(hdcDest, 0, 0, width, height, hdcSrc, 0, 0, SRCCOPY)
                ' restore selection
                GDI32.SelectObject(hdcDest, hOld)
                ' clean up 
                GDI32.DeleteDC(hdcDest)
                User32.ReleaseDC(handle, hdcSrc)
    
                ' get a .NET image object for it
                Dim img As Image = Image.FromHbitmap(hBitmap)
                ' free up the Bitmap object
                GDI32.DeleteObject(hBitmap)
    
                Return img
            End Function 'CaptureWindow
            '/ Captures a screen shot of a specific window, and saves it to a file
            Public Sub CaptureWindowToFile(ByVal handle As IntPtr, ByVal filename As String, ByVal format As ImageFormat)
                Dim img As Image = CaptureWindow(handle)
                img.Save(filename, format)
            End Sub 'CaptureWindowToFile
            '/ Captures a screen shot of the entire desktop, and saves it to a file
            Public Sub CaptureScreenToFile(ByVal filename As String, ByVal format As ImageFormat)
                Dim img As Image = CaptureScreen()
                img.Save(filename, format)
            End Sub 'CaptureScreenToFile
            Public Function CaptureDeskTopRectangle(ByVal CapRect As Rectangle, ByVal CapRectWidth As Integer, ByVal CapRectHeight As Integer) As Bitmap
                '/ Returns BitMap of the region of the desktop, similar to CaptureWindow, but can be used to 
                '/ create a snapshot of the desktop when no handle is present, by passing in a rectangle 
                '/ Grabs snapshot of entire desktop, then crops it using the passed in rectangle's coordinates
                Dim SC As New ScreenShot.ScreenCapture
                Dim bmpImage As New Bitmap(sc.CaptureScreen)
                Dim bmpCrop As New Bitmap(CapRectWidth, CapRectHeight, bmpImage.PixelFormat)
                Dim recCrop As New Rectangle(CapRect.X, CapRect.Y, CapRectWidth, CapRectHeight)
                Dim gphCrop As Graphics = Graphics.FromImage(bmpCrop)
                Dim recDest As New Rectangle(0, 0, CapRectWidth, CapRectHeight)
                gphCrop.DrawImage(bmpImage, recDest, recCrop.X, recCrop.Y, recCrop.Width, _
                  recCrop.Height, GraphicsUnit.Pixel)
                Return bmpCrop
            End Function
            '/ Helper class containing Gdi32 API functions
            Private Class GDI32
                Public SRCCOPY As Integer = &HCC0020
                ' BitBlt dwRop parameter
                Declare Function BitBlt Lib "gdi32.dll" ( _
                    ByVal hDestDC As IntPtr, _
                    ByVal x As Int32, _
                    ByVal y As Int32, _
                    ByVal nWidth As Int32, _
                    ByVal nHeight As Int32, _
                    ByVal hSrcDC As IntPtr, _
                    ByVal xSrc As Int32, _
                    ByVal ySrc As Int32, _
                    ByVal dwRop As Int32) As Int32
    
                Declare Function CreateCompatibleBitmap Lib "gdi32.dll" ( _
                    ByVal hdc As IntPtr, _
                    ByVal nWidth As Int32, _
                    ByVal nHeight As Int32) As IntPtr
    
                Declare Function CreateCompatibleDC Lib "gdi32.dll" ( _
                    ByVal hdc As IntPtr) As IntPtr
    
                Declare Function DeleteDC Lib "gdi32.dll" ( _
                    ByVal hdc As IntPtr) As Int32
    
                Declare Function DeleteObject Lib "gdi32.dll" ( _
                    ByVal hObject As IntPtr) As Int32
    
                Declare Function SelectObject Lib "gdi32.dll" ( _
                    ByVal hdc As IntPtr, _
                    ByVal hObject As IntPtr) As IntPtr
            End Class 'GDI32
            '/ Helper class containing User32 API functions
            Public Class User32
                <StructLayout(LayoutKind.Sequential)> _
                Public Structure RECT
                    Public left As Integer
                    Public top As Integer
                    Public right As Integer
                    Public bottom As Integer
                End Structure 'RECT
    
                Declare Function GetDesktopWindow Lib "user32.dll" () As IntPtr
    
                Declare Function GetWindowDC Lib "user32.dll" ( _
                    ByVal hwnd As IntPtr) As IntPtr
    
                Declare Function ReleaseDC Lib "user32.dll" ( _
                    ByVal hwnd As IntPtr, _
                    ByVal hdc As IntPtr) As Int32
    
                Declare Function GetWindowRect Lib "user32.dll" ( _
                    ByVal hwnd As IntPtr, _
                    ByRef lpRect As RECT) As Int32
    
            End Class 'User32
        End Class 'ScreenCapture 
    End Namespace 'ScreenShot
    Custom Drag Region Select.
    Code:
    Imports System.Math
    Public Class dragRegion
        Private MyRectangle As Rectangle
        Private Drawing As Boolean = False
        Private StartX, StartY, CursorX, CursorY As Single
    '###############################################################
        Private Sub Region_Drag_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
            If Drawing = True Then
                Dim Dashed_Pen As New Pen(Brushes.LightCoral, 4)
    
                Dashed_Pen.DashStyle = Drawing2D.DashStyle.Solid
                MyRectangle = New Rectangle(Min(StartX, CursorX), _
                                          Min(StartY, CursorY), _
                                          Abs(StartX - CursorX), _
                                          Abs(StartY - CursorY))
    
                e.Graphics.FillRectangle(New SolidBrush(Color.Fuchsia), MyRectangle)
                e.Graphics.DrawRectangle(Dashed_Pen, MyRectangle)
            End If
        End Sub
    '#################################################################
        Private Sub Region_Drag_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown 
         'Handle Expectations
        End Sub
        Private Sub Region_Drag_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
       'Do stuff
        End Sub
        Private Sub Region_Drag_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
     'Do stuff
        End Sub
        Private Sub Region_Drag_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
            'do stuff
        End Sub
        Private Sub Region_Drag_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
           'DO STUFF
        End Sub
    End Class

  2. The Following 5 Users Say Thank You to ThreadOP For This Useful Post:

    EliteTaco9000 (08-23-2014),jefferywinner (05-17-2015),louismark (11-15-2014),Thegunamn007 (12-14-2015),ZeroInsanity (08-20-2014)

  3. #2
    ZeroInsanity's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    root@Insanity
    Posts
    359
    Reputation
    10
    Thanks
    142
    My Mood
    Yeehaw
    Looked through the code. You sir deserve a +1. I use puush for screenshots, but now I can make GIF's too. Just have to wait for it to be auto approved.

  4. #3
    iSmexy's Avatar
    Join Date
    Dec 2011
    Gender
    female
    Posts
    16,204
    Reputation
    1355
    Thanks
    3,734
    @ @ThreadOP you must post VS for that

    List of Middleman Impersonations
    Current MPGH Staff
    Report a Scammer here


    Member Since: 5 Dec 2011
    Crossfire Minion Since: 19 Feb 2013 - 24 Oct 2014
    Minecraft Minion Since: 4 Feb 2014 - 24 Oct 2014
    BattleOn Minion Since: 26 Aug 2014 - 24 Oct 2014
    Donator Since: Mar 12 2014


     

    x x

  5. #4
    ThreadOP's Avatar
    Join Date
    Jul 2014
    Gender
    female
    Posts
    23
    Reputation
    10
    Thanks
    91
    Quote Originally Posted by iSmexy View Post
    @ @ThreadOP you must post VS for that
    Do it your self noob. Isn't that your job? >_>* if you can't tell I'm highly disappointed in your quality of minion service towards this section...


    Until the programming sections get a better minion I'm not posting the source or anything else VB, C / ASM, or anything Reverse engineering wise.

    Here is your faulty Public Virus Scans noob.
    https://virusscan.jotti.org/en/scanre...64ef9a21df631a
    https://www.virustotal.com/en/file/e...is/1408654092/

    As Overseer of this section you should be the one to reflect simple .NET files to see if you can view the source your self to further determine if things are viruses or not. The fact you would just be so lazy as to just say "you must post VS for that" without taking the time to do it your self after you already viewed the file is just down right pathetic.

    Seriously, you making that post on this thread in this section is just so ridiculous. Why are you even minion? You obviously are too lazy to check if files are clean or not, let alone take the extra step to assure the file is 100% not harmful and if it is in anyway whats so ever post your findings and ask or explain why you believe so.

  6. The Following User Says Thank You to ThreadOP For This Useful Post:

    EliteTaco9000 (08-23-2014)

  7. #5
    iSmexy's Avatar
    Join Date
    Dec 2011
    Gender
    female
    Posts
    16,204
    Reputation
    1355
    Thanks
    3,734
    Quote Originally Posted by ThreadOP View Post
    Do it your self noob. Isn't that your job? >_>* if you can't tell I'm highly disappointed in your quality of minion service towards this section...


    Until the programming sections get a better minion I'm not posting the source or anything else VB, C / ASM, or anything Reverse engineering wise.

    Here is your faulty Public Virus Scans noob.
    https://virusscan.jotti.org/en/scanre...64ef9a21df631a
    https://www.virustotal.com/en/file/e...is/1408654092/

    As Overseer of this section you should be the one to reflect simple .NET files to see if you can view the source your self to further determine if things are viruses or not. The fact you would just be so lazy as to just say "you must post VS for that" without taking the time to do it your self after you already viewed the file is just down right pathetic.

    Seriously, you making that post on this thread in this section is just so ridiculous. Why are you even minion? You obviously are too lazy to check if files are clean or not, let alone take the extra step to assure the file is 100% not harmful and if it is in anyway whats so ever post your findings and ask or explain why you believe so.
    not even minion here and cant even download it

    List of Middleman Impersonations
    Current MPGH Staff
    Report a Scammer here


    Member Since: 5 Dec 2011
    Crossfire Minion Since: 19 Feb 2013 - 24 Oct 2014
    Minecraft Minion Since: 4 Feb 2014 - 24 Oct 2014
    BattleOn Minion Since: 26 Aug 2014 - 24 Oct 2014
    Donator Since: Mar 12 2014


     

    x x

  8. #6
    Hero's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    memes
    Posts
    40,140
    Reputation
    4764
    Thanks
    9,683
    / Approved
    [] [] [] [][]

    Editor from 06•14•2011 • 2014
    Donator since 09•16•2011
    Minion from 10•10•2011 • 01•06•2011
    Minion+ from 01•06•2012 • 08•08•2012
    Moderator from 08•08•2012 • 10•06•2012
    Global Moderator from 10•06•2012 • 12•05•2017
    Staff Administrator from 12•05•2017 • 05•01•2019
    Trusted Member since 07•13•2019
    Global Moderator since 09•11•2020




Similar Threads

  1. [OPEN CHALLENGE] [NO PRIZES] Create an animated signature.[JUST FOR FUN]
    By creepycanada in forum Challenges & Competitions
    Replies: 1
    Last Post: 04-24-2013, 10:13 PM
  2. [Help] How to create Clan Animating Logo?
    By remzkee0903 in forum CrossFire PH Discussions
    Replies: 9
    Last Post: 01-16-2013, 11:01 PM
  3. [Help Request] How to create Clan Animating Logo?
    By remzkee0903 in forum CrossFire Help
    Replies: 11
    Last Post: 01-11-2013, 06:58 AM
  4. How to create an animated border!
    By bowlcut in forum Tutorials
    Replies: 24
    Last Post: 07-12-2010, 09:48 PM
  5. How to Create Animated GIF Images!
    By Justin in forum Art & Graphic Design
    Replies: 9
    Last Post: 12-14-2009, 11:42 PM