Solved

Saving a picture into gif format

Posted on 2003-12-04
4
178 Views
Last Modified: 2013-12-25
Does anyone know how to save a picture in a gif?
im using vb 5.

Details:

Get a screen shot
save it in gif format (256 colors)
open the picture in vb


only it :)

thx for the help.
0
Comment
Question by:S-L-D-
4 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 50 total points
ID: 9880584
http://www.vbcode.com/asp/showzip.asp?ZipFile=capbit.zip&theID=165
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=948&lngWId=1
http://www.vbcode.com/asp/showzip.asp?ZipFile=http%3A%2F%2Fsneaky900%2Ehomestead%2Ecom%2Ffiles%2FZoom%2Ezip&theID=3496
http://www.vbcode.com/asp/showzip.asp?ZipFile=http%3A%2F%2Fwww%2Evbcode%2Ecom%2Fcode%2Fscreenshot02262002%2Ezip&theID=6300
http://www.vbcode.com/asp/showsn.asp?theID=6017

These are all programs to capture the screen. Including the source-files.


run the code and press spacebar:

Option Explicit
Private Type POINTAPI
       x As Long
       y As Long
End Type
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetCursor Lib "user32" () As Long
Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long

Dim hwndDW As Long
Dim dcDW As Long
Dim pt As POINTAPI
Private Sub Form_KeyPress(KeyAscii As Integer)
With Me
  If KeyAscii = 32 Then 'spacebar
     GetCursorPos pt
     BitBlt .hdc, 0, 0, .ScaleWidth, .ScaleHeight, dcDW, 0, 0, vbSrcCopy
     DrawIcon .hdc, pt.x, pt.y, GetCursor
  End If
End With
End Sub

Private Sub Form_Load()
hwndDW = GetDesktopWindow()
dcDW = GetWindowDC(hwndDW)

End Sub
0
 

Expert Comment

by:COOMET
ID: 9881819
0
 

Author Comment

by:S-L-D-
ID: 10020554
>How about the link below ?
>
>http://www.freevbcode.com/ShowCode.Asp?ID=3533

the program is so slow... any faster?

thx
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now