Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > C# ต้องการ capture หน้าจอ เป็น VDO ต้องทำอย่างไรครับ เริ่มไม่ถูก ^^



 

C# ต้องการ capture หน้าจอ เป็น VDO ต้องทำอย่างไรครับ เริ่มไม่ถูก ^^

 



Topic : 069595



โพสกระทู้ ( 20 )
บทความ ( 0 )



สถานะออฟไลน์




c# ต้องการ capture หน้าจอ เป็น VDO ต้องทำอย่างไรครับ เริ่มไม่ถูก ^^
บันทึกเป็น VDO เก็บลงเครื่องครับ



Tag : .NET, C#









ประวัติการแก้ไข
2011-11-27 01:15:42
2011-11-27 01:15:57
2011-11-27 01:19:05
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2011-11-27 01:14:22 By : TELESIS View : 2029 Reply : 3
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

C# Capture VDO

Code (C#)
		private void Form1_Load(object sender, System.EventArgs e)
		{
			// set the image capture size
			this.WebCamCapture.CaptureHeight = this.pictureBox1.Height;
			this.WebCamCapture.CaptureWidth = this.pictureBox1.Width;
		}

		private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			// stop the video capture
			this.WebCamCapture.Stop();
		}

		/// <summary>
		/// An image was capture
		/// </summary>
		/// <param name="source">control raising the event</param>
		/// <param name="e">WebCamEventArgs</param>
		private void WebCamCapture_ImageCaptured(object source, WebCam_Capture.WebcamEventArgs e)
		{
			// set the picturebox picture
			this.pictureBox1.Image = e.WebCamImage;
		}

		private void cmdStart_Click(object sender, System.EventArgs e)
		{
			// change the capture time frame
			this.WebCamCapture.TimeToCapture_milliseconds = (int) this.numCaptureTime.Value;

			// start the video capture. let the control handle the
			// frame numbers.
			this.WebCamCapture.Start(0);

		}

		private void cmdStop_Click(object sender, System.EventArgs e)
		{
			// stop the video capture
			this.WebCamCapture.Stop();
		}

		private void cmdContinue_Click(object sender, System.EventArgs e)
		{
			// change the capture time frame
			this.WebCamCapture.TimeToCapture_milliseconds = (int) this.numCaptureTime.Value;

			// resume the video capture from the stop
			this.WebCamCapture.Start(this.WebCamCapture.FrameNumber);
		}
	}


http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1339&lngWId=10






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-11-27 08:11:01 By : webmaster
 


 

No. 2



โพสกระทู้ ( 169 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook Blogger

เอาอันนี้ไปดูไอ้น้องรับรองตอบคำถามครับพี่น้อง

http://kishordgupta.wordpress.com/2011/02/01/step-by-step-to-create-a-desktop-video-recorder-in-c/

Download sample project: http://www.multiupload.com/BR4MF5TEYM

วิธีใช้งาน
1. แตกไฟล์ desktopvideomaker.rar
2. เข้าไปที่ desktopvideomaker\ScreenCapture\bin\Debug
3. Double click ScreenCapture.exe
4. กดปุ่ม Start
5. โปรแกรมจะเริ่ม capture desktop screen
6. เมื่อพอใจกดปุ่ม Cancel
7. ไปดู video file ได้ที่ desktopvideomaker\ScreenCapture\Output

ตัวอย่างโปรแกรมดุได้ใน Project ที่โหลดมาได้ด้วยเหมือนกันครับพีน้อง

Code (C#)
#region Using directives

///kishor datta gupta
///[email protected]
///www.kishordgupta.wordpress.com

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using AviFile;
using System.Threading;
using System.IO;
#endregion
namespace ScreenCapture
{
    public partial class Form1 : Form
    {
        AviManager aviManager = new AviManager(@"..\..\Output\output.avi", false);
        int ScreenWidth = Screen.PrimaryScreen.Bounds.Width;
        int ScreenHeight = Screen.PrimaryScreen.Bounds.Height;
        VideoStream aviStream = null;
        public Form1()
        {

            InitializeComponent();
        }

        public void startrecording()
        {
                Graphics g;
                Bitmap b = new Bitmap(ScreenWidth, ScreenHeight);
                g = Graphics.FromImage(b);
                g.CopyFromScreen(Point.Empty, Point.Empty, Screen.PrimaryScreen.Bounds.Size);
                aviStream.AddFrame(b);
                b.Dispose();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Graphics g;
            Bitmap bi = new Bitmap(ScreenWidth, ScreenHeight);
            g = Graphics.FromImage(bi);
            g.CopyFromScreen(Point.Empty, Point.Empty, Screen.PrimaryScreen.Bounds.Size);
            aviStream = aviManager.AddVideoStream(true,4, bi);
            bi.Dispose(); ; ;
            timer1.Enabled = true;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            aviManager.Close();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            startrecording();
        }
    }
}



http://www.facebook.com/profile.php?id=100003191106723&ref=tn_tnmn


ประวัติการแก้ไข
2011-11-27 15:36:27
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-11-27 15:32:14 By : pStudio
 

 

No. 3



โพสกระทู้ ( 20 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณมากๅครับผม
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-11-27 20:47:21 By : TELESIS
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : C# ต้องการ capture หน้าจอ เป็น VDO ต้องทำอย่างไรครับ เริ่มไม่ถูก ^^
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 04
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่