简体   繁体   English

结合Javascript和C#GUI

[英]Combining Javascript- and C# GUI

I would like to make an application for displaying images from a local directory, however using a given javascript GUI framework for filtering the contents. 我想制作一个用于显示本地目录中图像的应用程序,但是使用给定的javascript GUI框架过滤内容。 How could this be done? 怎么办呢?

I tried with Windows 8 Store Application: - Only Javascript / Html 5: I failed by reading the pictures from the pictureLibrary by javascript. 我尝试使用Windows 8 Store Application:-仅Javascript / HTML 5:我无法通过javascript从pictureLibrary中读取图片。 Displaying the pictures is also difficult, as dynamic content is not allowed and most frameworks use it. 显示图片也很困难,因为不允许动态内容,并且大多数框架都使用它。 - Only Xaml/WinRT: How to integrate the Javascript GUI? -仅Xaml / WinRT:如何集成Javascript GUI? - Combinatin of both: Is there a way to use Javascript and Xaml GUIs together?? -两者的结合:是否可以同时使用Javascript和Xaml GUI?

I know I could accomplish it with a webapplication, but I would like to program it for the desktop in an application way. 我知道我可以使用Web应用程序完成此操作,但是我想以一种应用程序方式在桌面上对其进行编程。

This can be done through WinRT Components , though I think it's easiear to write an entire HTML5 app and learn how to display images, easy as: 这可以通过WinRT Components完成,尽管我认为编写一个完整的HTML5应用程序并学习如何显示图像非常容易,例如:

var pictureLibrary = Windows.Storage.KnownFolders.picturesLibrary;
pictureLibrary.getFilesAsync(query).then(function (items) {
 for (var i = 0; i < items.length; i++) {
    var image = document.createElement("img");
    image.src = URL.createObjectURL(items[i]);
    container.appendChild(image);
  }
};

Keeping in mind that "container" is where you want to display the images. 请记住,“容器”是您要显示图像的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM