How do i save pictures from a picturebox that update every 2 sec from a a screenshot
pretty much what i said. here is some of the code that i have:
Code:
Public Function CaptureImage(ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, ByVal Height As Integer) As Bitmap
Dim JPEG As New Bitmap(Width, Height)
Dim G As Graphics = Graphics.FromImage(JPEG)
G.CopyFromScreen(New Point(X, Y), New Point(0, 0), JPEG.Size)
G.Dispose() : Return JPEG
End Function
'--------------
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'--------------
' "screenshot" is the picturebox on form 3
Form3.screenshot.Image = CaptureImage(Form4.Location.X, Form4.Location.Y, Form4.ClientSize.Width, Form4.ClientSize.Height)
End Sub
when the timer hits a 2 second interval the picturebox on form 3 gets a new image from the screen shot that form 4 takes off of form4's area. i want the user to select a folder with the "folder browser dialog" and i want each frame capture to be saved to the folder (every 2 seconds) that the user chooses as "1.jpg, 2.jpg, 3.jpg" etc could you please give me a good idea and some code on how to do this thank you. p.s if you need a better idea or more code examples on what I'm trying to say, just ask. thanks again
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
try something like this: x = x + 1
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
screenshot.Save([type where should it be saved's folder])
* i will give u the full code, just give me few minutes
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
thank you Doraemon i'll be waiting :D
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
create a control "folderbrowsedialog"
create a button named "button1", when you clicked on it, it will show up a folderbrowsedialog
Code:
Public Class form3
Dim x As Integer
Public Function CaptureImage(ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, ByVal Height As Integer) As Bitmap
Dim JPEG As New Bitmap(Width, Height)
Dim G As Graphics = Graphics.FromImage(JPEG)
G.CopyFromScreen(New Point(X, Y), New Point(0, 0), JPEG.Size)
G.Dispose() : Return JPEG
End Function
'--------------
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'--------------
' "screenshot" is the picturebox on form 3
Me.screenshot.Image = CaptureImage(form4.Location.X, form4.Location.Y, form4.ClientSize.Width, form4.ClientSize.Height)
x = x + 1
screenshot.Image.Save(FolderBrowserDialog1.SelectedPath & "\" & x & ".jpg")
End Sub
Private Sub form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
form4.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
FolderBrowserDialog1.ShowDialog()
Timer1.Start()
End Sub
End Class
rate me so i doesn't only have http://www.vbforums.com/images/reput...tation_pos.gif
i need http://www.vbforums.com/images/reput...tation_pos.gifhttp://www.vbforums.com/images/reput...tation_pos.gifhttp://www.vbforums.com/images/reput...tation_pos.gifhttp://www.vbforums.com/images/reput...tation_pos.gifhttp://www.vbforums.com/images/reput...tation_pos.gifhttp://www.vbforums.com/images/reput...tation_pos.gifhttp://www.vbforums.com/images/reput...tation_pos.gifhttp://www.vbforums.com/images/reput...tation_pos.gif
:D XD
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
Thank you so much !! i've been making this program for about a week and this is the main feature and you just helped me figure it out... THANK YOU :D. how do you add friends on this forum you defiantly one of mine?
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
I am not pro at VB.net, this is my first time helping other, i am too happy to saw you done it :)
1. click on this:
http://www.vbforums.com/profile.php?...riend&u=138364
2. click on this (rate me):
http://www.vbforums.com/reputation.php?p=4095477
(if not working, click on "Rate this post")
3. you should make atleast 10 posts so your posts doesn't need vertification by moderators :D
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
Done and Done & good idea i didn't even know that
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
do you rated me? i still only have 5 point only
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
i tried the link but this time ill click "rate this post"... did you accept my friend request :p?
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
yeah i clicked "rate this post" and it said "you can not give reputation to the same post twice" ??
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
then you give rate on all my post hahaha XD
addon, i had already added you
addon 2, you had reached 10 post!
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
lol awsome, here's another question I want to basically want to stop the screenshot's of wm player when the video stops or even when the progress that i have gets to the end which it is coded to sync with the duration of the video. any idea on how to do that ?? this is what i have for the progressbar
vb Code:
'Form 1
Private Sub AxWindowsMediaPlayer1_PlayStateChange(ByVal sender As System.Object, _
ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles AxWindowsMediaPlayer1.PlayStateChange
If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsPlaying Then
Form3.ProgressBar1.Maximum = CInt(AxWindowsMediaPlayer1.Ctlcontrols.currentItem.duration)
Form3.Timer1.Start()
ElseIf AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsPaused Then
Form3.Timer1.Stop()
ElseIf AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsStopped Then
Form3.Timer1.Stop()
Form3.ProgressBar1.Value = 0
End If
End Sub
'Form 3 (with progress bar and picturebox)
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Form1.AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsPlaying Then
ProgressBar1.Value = CInt(Form1.AxWindowsMediaPlayer1.Ctlcontrols.currentPosition)
End If
End Sub
Thanks =)
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
can you create a new thread? addon, i still not understand what you saying, say more clearer?
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
okay so what the program does is it takes a screenshot of the axwindowsmediaplayer plug-in every 2 seconds with a invisible form over the windows media player plug-in it then shows it on a picturebox and saves it to a jpeg every 2 seconds (which you helped me with :P) what i want it to do though is when the video stops playing i want it to stop making jpegs.
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
you can make it by comparing the difference between the image, code i will make it too ==, few minutes is required
or i can do it by another way... wait is still need ==
i had just reviewed your code, this should already does what it should does:
Quote:
ElseIf AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsStopped Then
Form3.Timer1.Stop()
if you really want me to edit whole project, please send me your project file
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens
k obviously your preoccupied with something else now lol, i have to go to sleep now anyway it's 1:50 am in my time zone and i have to get up for school a 7:50 am so don't know how i'm gonna do that :S but it was a nice talk and i got some good expertise from you my friend. anyways signing off now... ill talk to you tomorrow and once again thank you so much for your help :)
Re: How do i save pictures from a picturebox that update every 2 sec from a a screens