Solved

Saving a picture into gif format

Posted on 2003-12-04
4
185 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-
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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
MsgBox 2 61
Adding to a VBA? 6 84
Recommendation vb6 to vb.net or others 14 205
Collapse and expand table in Word 2010 2 98
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…

749 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