facebook, camera emgcv use .



Comments



Description

Unfied software suit (facebook ,pdf editor ,photo edit ,searching files.webcam) using .net c# Introduction A computer user can be any one paprgrammer or non programmer .so I decided to make a software which include most of the daily task of our computuing life . after the deail servay of computer users(4rnds and family) I found that most of the people read pdf files,use social networks(sharing pictures) edit photos. The idea is to provide a unified solution of many problems. I call it unified software suit . Libraries: (1) Emgu CV is a cross platform .Net wrapper to the OpenCV image processing library. Allowing OpenCV functions to be called from .NET compatible languages such as C#, VB, VC++, iPhone. EventArgs e) { // you need to check if its initialzed or not if not then initialize it #region if capture is not created. create check-ins or any of the other tasks that an app might need to do. iPad and Android devices.IronPython etc. Facebook's Open Graph allows you to define new objects and actions in a user's social graph. // Application.Message). in event of the camera button(on/off) private void btnStart_Click(object sender. step 1 add libraries using Emgu. using Emgu. All of the software depends upon these libraries. .CV. Mac OS X. using Emgu.Util.Structure.Show(excpt. Webcam: here we need emgcv open source library .CV.// 0 is default video device } catch (Exception excpt) { MessageBox. The wrapper can be compiled in Mono and run on Windows. (2) facebook ghraph api : The Graph API is the primary way to get data in and out of Facebook's social graph. and the way that you create new instances of those actions and objects is via the Graph API In this solution you need this library hardly. Linux. } } #endregion if (capture != null) { if (captureInProgress) { //if camera is getting frames then stop the capture and set button Text // "Start" for resuming capture btnStart.Idle -= ProcessFrame. create it now if (capture == null) { try { capture = new Capture(0). post new stories.Text = "Start!". It's a low-level HTTP-based API that you can use to query data. } Step 2 Now we want to add multiple special effects in picture boxes we have added 6 picture box .Text = "Stop". btnStart.BackColor = Color.} else { //if camera is NOT getting frames then start the capture and set button // Text to "Stop" for pausing capture btnStart.Red. Application. } captureInProgress = !captureInProgress.Idle += ProcessFrame. creat a facebook client instance token is the acces token of your facebook profile then creat a dictionary throught aces token . Byte> cannyFrame = smoothedGrayFrame. //capture image frame // it’s a wrapper of ipllimage of open cv bgr stand for blue green red . Image<Gray.QueryFrame(). new Gray(40)). try { FacebookClient fc = new FacebookClient("token"). Now our next module Uploading files to facebook Introduction : Uploading files via a desktop application in just one click.Image = imageBox4. of message and your profile id . blurr. smallGrayFrame. = frame.Canny(new Gray(80). Byte> smoothedGrayFrame = smallGrayFrame.try { Image<Bgr. var parameters = new Dictionary<string. Byte> xtra = grayFrame.Image = imageBox3. Byte> smallGrayFrame = grayFrame. 20). Byte> blurr = cannyFrame. Image<Gray. Image<Gray.PyrDown().Image = } catch (Exception) { } xtra. Byte> frame = capture. Image<Gray.SmoothBilatral(11. 12. smoothedGrayFrame. 33). Image<Gray. cannyFrame. Here it is .PyrUp(). Now assign each image box above effects .Image = imageBox2.Image = CamImageBox. imageBox5. we acces facebook accounts note acces token expire after new login . He idea is to provide a interface to uploading pictures pictures from desktop Add library using Facebook.SmoothBlur(10. object> . it’s a 8bit //image Adding image color effects Image<Gray. Byte> grayFrame = frame. Byte>().Convert<Gray.Image imageBox1. Show("photos uploaded ").Show("Uploading failed check your connection!! "). upload.Text. now facebook client upload photo to photos . "id "} }.SetValue(fileBytes). } catch (Exception E) { MessageBox. fc. tb). string tb = textBox1. "hello"}. mediaObject.Post("photos". . photos represent the photos of your facebook account that’s it . } Module 3 : Now about my searching algorithm This is how its look like . {"place".Add("name". MessageBox.{ {"message".ReadAllBytes(@"" + file). object>(). upload). Now select file to upload We convert files into bytes byte[] fileBytes = File. IDictionary<string. object> upload = new Dictionary<string. SmallImageList = img.LargeImageList = img.100).Text).png").Depth32Bit.SelectedNode. listView1. TreeViewEventArgs e) { listView1.FromFile("q.FromFile("folder.Add( img1).FromFile(@"icon_PDF. } Now for after click event add this code to show the sub directries private void treeView1_AfterSelect(object sender.Clear().ColorDepth = ColorDepth.//1 img. Step 2 : Now how I have hard coded the images for the files according to their types .Add(img1). foreach(String id in ids) { treeView1. img1 = Image. try { String[] dirs = Directory. Image img1. img.Add(id). listView1. listView1. img. img1 = Image.GetDirectories(treeView1.SelectedNode. ImageList img = new ImageList().StateImageList = img.//0 img. img1 = Image.GetFiles(treeView1. . String[] dir = Directory.Images.jpg").Images.jpg").GetLogicalDrives(). Here we are setting the thumbnail size of files it will show .Text).Step 1 get logical drives I have used tree for side menu and for detail view or thumbnail views as list view String[] ids = Directory.Add(img1).//2 img.Nodes.ImageSize = new Size(100.Images. Images.Add( img1).doc") || S.mp3") || S.png") || S.jpeg") || S. int t = 11.Add( img1).Images.Contains(".bmp") || S.Add(img1).FromFile(@"Doc.Contains(".jpg").Add( img1). img1 = Image.Contains(". img1 = Image.//9 img.SelectedNode.//5 img.img1 = Image.Add( img1).Contains(".Images.flv")||S.ppt") || S.Contains(".Contains(".jpg").FromFile(@"excel. img1 = Image.mp4") || S.Contains(".Images.Add(img1).Contains(".Contains(". .xlsx") || S.jpeg") || S.rar") || S.Items. } foreach (String S in dir) { Here I am detecting what kind of files are present if the file is un known then we can give it uknown icon image.Contains(".docx") || S.Nodes.Contains(".doc") || S.Contains(".pdf") || S.Images.FromFile(@"txt.FromFile(@""+S).Contains(".Images.Contains(".Add( img1). if ((S. img. treeView1.FromFile(@"pic.FromFile(@"vlc.Contains(".jpg").Contains(".FLV") || S.Images. img1 = Image. img1 = Image.Contains(".jpg") || S.//6 img.FromFile(@"exe.Contains(".Contains(".png").mkv") || S.png").Add(S).avi") || S.png")) { Image image = Image.Contains(".jpg").FromFile(@"rar.jpg").Contains(".xls")))) { Step 3: Get the images from the pictures only .Add( img1).Contains(".exe") || S.//3 img.Images.Contains(".//7 img.//4 img.FromFile(@"ppt.Contains(". foreach (String S in dirs) { listView1.txt") || (S. for folder and exe files we have hard coded icons if (S.//8 img.zip") || S.bmp") || S.Add(S.Contains(".docx") || S.jpg") || S.Contains(".jpg"). img1 = Image. img1 = Image.0). Images.ppt")) { listView1.5 ).rar") || S. 8).xls") || S.Add(S.Add(image).Contains(". } if (S.Add(S.Contains(". 6).Items.exe")) { listView1. 3).txt")) { listView1.pdf")) { listView1.Contains(". 7).Items. listView1.Items.Add(S.Contains(".Contains(".Items. 2).Contains(".xlsx")) { listView1. } if (S. } if (S. } if (S. 4).Items.Contains(".Contains(".Add(S.Items.Items.Add(S.docx")) { listView1. . } if (S.Add(S.Add(S. t++.Items.doc") || S. } if (S.Contains(".img.zip")) { listView1.Contains(". t).Add(S. } if (S. Contains(".} if (S.mkv") || S.avi") || S.Add(S.mp4")) { listView1.Message).mp3") || S. 9).FLV") || S.Items.Items.Add(S.flv") || S.Contains(".Contains(".Contains(".Show(E.Contains(".Contains(".1). } } } catch (Exception E) { MessageBox. } }else{ listView1. } .
Copyright © 2024 DOKUMEN.SITE Inc.