1 / 20

Library/API

Library/API. Overview. Library/API คืออะไร ตัวอย่าง Library/API ที่น่าสนใจ Google Maps API COM Component (video flash shockwave) Windows API Adobe PDF Reader API website ที่น่าสนใจในการหา Library/API. Library/API คืออะไร.

Download Presentation

Library/API

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Library/API

  2. Overview • Library/API คืออะไร • ตัวอย่าง Library/API ที่น่าสนใจ • Google Maps API • COM Component (video flash shockwave) • Windows API • Adobe PDF Reader API • website ที่น่าสนใจในการหา Library/API

  3. Library/API คืออะไร คือชุดของคำสั่งที่มีผู้เขียนไว้ เพื่อให้ผู้อื่นสามารถนำไปใช้ในการเขียนโปรแกรมได้ง่าย และสะดวกขึ้น • Library • ชุดของคำสั่งที่รวบรวมเพื่อเขียนโปรแกรมเฉพาะเจาะจง • Image Library สามารถจัดการกับรูปภาพ เช่น การปรับสี ย่อขยายรูป • รูปแบบของ Library เช่น ไฟล์ .cs .dll • API (Application Program Interface) • ติดต่อผ่าน Interface ที่ผู้เขียนเปิดให้บริการไว้ • รูปแบบของ API เช่น ติดต่อผ่านเวบ ติดต่อผ่าน dll

  4. ตัวอย่าง Library/API ที่น่าสนใจ Google Maps API Adobe PDF Reader API COM Component Aforce Image Filter API

  5. ตัวอย่าง Library/API ที่น่าสนใจGoogle Maps API • static map • เรียกใช้ API ผ่านเวบ โดยใช้ urlที่มีการกำหนดตัวแปรเพื่อได้ภาพที่ต้องการ • ผลลัพธ์ที่ได้ http://maps.google.com/staticmap?center=13.841246,100.575907&size=500x300&maptype=hybrid&zoom=16&markers=13.841246,100.575907,bluea|13.842246,100.575907,midgreenb|13.841246,100.576907

  6. ตัวอย่าง Library/API ที่น่าสนใจGoogle Maps API • รูปแบบการเรียกใช้ API • http://maps.google.com/staticmap?parameter=value&...&parameter=value • Parameter • centerตำแหน่งพิกัดละติจูด ลองติจูดx,yที่ตรงกลางของรูป • sizeขนาดของรูปเป็น pixelwidthxheight • zoomอัตราการขยาย0ถึง19 • markers ทำเครื่องหมายบนแผนที่ที่ละติจูด ลองติจูดx,y • maptypeรูปแบบของแผนที่ roadmap mobile satellite hybrid

  7. ตัวอย่าง Library/API ที่น่าสนใจGoogle Maps API roadmap mobile satellite hybrid

  8. ตัวอย่าง Library/API ที่น่าสนใจCOM Component • Windows Component • Windows media player • Shockwave flash object

  9. ตัวอย่าง Library/API ที่น่าสนใจCOM Component • วิธีการเรียกใช้ Component 2 3 1 5 4

  10. ตัวอย่าง Library/API ที่น่าสนใจCOM Component // Windows media player axWindowsMediaPlayer1.URL = "http://www.ku.ac.th/general/ku.wmv"; axWindowsMediaPlayer1.URL = @“C:\music.mp3"; // play axWindowsMediaPlayer1.Ctlcontrols.play(); // stop axWindowsMediaPlayer1.Ctlcontrols.stop(); // repeat when end axWindowsMediaPlayer1.settings.setMode("loop", true); // volume axWindowsMediaPlayer1.settings.volume = 100 // Shockwave Flash Object axShockwaveFlash1.Movie = "http://pirun.ku.ac.th/~b4905122/meClient.swf";

  11. ตัวอย่าง Library/API ที่น่าสนใจWindows API • Clipboard • คือที่เก็บข้อมูลชั่วคราว เมื่อมีการ cut หรือ copy และจะเก็บจนกว่าจะมีการเก็บทับ ซึ่งผู้ใช้สามารถ paste เพื่อนำข้อมูลนั้นกลับมาใช้ • ชนิดของ Clipboardได้แก่ audio image file text data(กำหนดเอง) • ตัวอย่างการเรียกใช้งาน // ตรวจสอบว่า clipboard เป็นชนิด text หรือไม่ if (Clipboard.ContainsText()) // กำหนดให้ข้อความใน textBox1 เป็นข้อความใน clipboard textBox1.Text = Clipboard.GetText(); // ตั้ง clipboard ให้เป็น Hello World Clipboard.SetText(“Hello World"); // clear ค่าที่เก็บใน clipboard Clipboard.Clear();

  12. ตัวอย่าง Library/API ที่น่าสนใจWindows API • Mouse // get ขนาดของหน้า desktop int X = Screen.PrimaryScreen.Bounds.Width; int Y = Screen.PrimaryScreen.Bounds.Height; // set ตำแหน่งของ cursor บนหน้าจอ Cursor.Position = new Point(X/2,Y/2); // สั่งให้เมาส์ click -- ใน wiki // สั่งให้เมาส์double click -- ใน wiki

  13. ตัวอย่าง Library/API ที่น่าสนใจWindows API • Keyboard 1 2 3 using Microsoft.VisualBasic.Devices; // สั่งให้ keyboardพิมพ์ Keyboard kb = new Keyboard(); kb.SendKeys(“Easy Easy:P") ;

  14. ตัวอย่าง Library/API ที่น่าสนใจWindows API • Keyboard • //ให้โปรแกรมทำอะไรบางอย่างเมื่อกดปุ่ม • -- ใน wiki

  15. ตัวอย่าง Library/API ที่น่าสนใจAdobe PDF Reader API • สามารถใช้ API ได้จากการติดตั้ง Adobe Acrobat Reader • จะต้องมีไฟล์ AcroPDF.dllใน C:\Program Files\Common Files\Adobe\Acrobat\ActiveX\ (ค่ามาตรฐาน) • ความสามารถ • แสดงหน้า PDF • จัดการรูปแบบ หน้าแสดงผลของPDF

  16. ตัวอย่าง Library/API ที่น่าสนใจAdobe PDF Reader API 2 • วิธีเรียกใช้ 3 1 5 4

  17. ตัวอย่าง Library/API ที่น่าสนใจAdobe PDF Reader API • ตัวอย่างการเปิด PDF axAcroPDF1.LoadFile(@“D:\programming.pdf"); // เปิดPDF axAcroPDF1.setShowToolbar(false); //ซ่อนtoolbarข้างบน axAcroPDF1.setCurrentPage(10); // เปิดหน้าที่ต้องการ axAcroPDF1.setZoom(200.0); //อัตราขยายมุมมอง

  18. website ที่น่าสนใจในการหา Library/API • http://www.codeplex.com/ • http://code.google.com/p/ • http://sourceforge.net/ • http://www.codeproject.com/ ข้อแนะนำ: ใช้คำว่า .netหรือ C# ประกอบกับการค้นหา

  19. สามารถดูรายละเอียด และหา Library/API ที่น่าสนใจอื่นๆเพิ่มเติมได้ที่ http://158.108.202.57/w/index.php ?title=Library/API_Example

  20. ขอบคุณครับ : )

More Related