Skip to content

Instantly share code, notes, and snippets.

@donavon
donavon / getThumbnailFromWebView.js
Last active March 22, 2016 06:17
`transformImageStream` is a WinJS (Windows 8) utility to transform an image stream. The sample code to get a snapshot from a WebView control requires Windows 8.1.
// Takes a snapshot of WebView control (Windows 8.1) and returns a thumbnail URL.
function getThumbnailFromWebView(webviewControl, width, height) {
return capturePreviewToBlobAsync(webviewControl).then(function (completeEvent) {
var blob = completeEvent.target.result;
var streamIn = blob.msDetachStream();
var Imaging = Windows.Graphics.Imaging;
var transform = new Imaging.BitmapTransform();
transform.scaledHeight = height;
transform.scaledWidth = width;
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing