Solved

Saving a picture into gif format

Posted on 2003-12-04
4
182 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA: Select SQL query based on a config Sheet v2 11 49
Child Form in front 4 49
Problem to With line 4 63
IF ELSE Statement in Excel Macro VBA 16 75
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

831 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