Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resize screenshot

Status
Not open for further replies.

Drivenn

Programmer
Mar 26, 2004
13
FI
Hi,

I have program that takes screenshot and saves it to directory. My problem is that it saves the screenshot size of 1,5 mb. I want it to be about 100 kb or less. How you do that?

My code:

Public Function Capture_Desktop(ByVal Destination$) As Boolean

On Error GoTo errl
DoEvents
Call keybd_event(vbKeySnapshot, 1, 0, 0)
DoEvents
SavePicture Clipboard.GetData(vbCFBitmap), Destination$
Capture_Desktop = True


Exit Function
errl:
MsgBox "noup"

Capture_Desktop = False
Timer1.Enabled = False
Me.WindowState = 0
End Function

Private Sub Command1_Click()
On Error Resume Next

Me.Caption = Text10.Text
Capture_Desktop App.Path & "\Report_" + Text10.Text + Text11.Text + ".jpg"

If Text10.Text = "50" Then
Me.Caption = "Press start again for more shots"
End If

End Sub



Thanks!
 
As far as I know, vb6 just basically does the equivalent of opening a file in MSPaint 98 and putting in a .jpeg extension- it's still basically a bitmap.

I had a real pain of a time doing exactly what you want a couple years ago, and I don't think there's an easy way to compress a jpeg in-code with vb6 - you might want to look into using a premade module that'll do it for you- try this link:

 
That's right; SavePicture only knows how to save in bitmap format

>I don't think there's an easy way to compress a jpeg in-code with vb6

Well, it can be done...
 
well, I thought that too. screenshot is taken cause it's been sending via email to recipient and 1,5mb is too much. Is there any way to send form ín some reasonal format?
 
Check out the links and code I provide in thread222-760856
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top