Skip to content

Instantly share code, notes, and snippets.

Imports Microsoft.Office.Interop.PowerPoint
Public Class ThisAddIn
Private Sub Application_SlideShowNextSlide(Wn As SlideShowWindow) Handles Application.SlideShowNextSlide
Dim r = New Random
Dim s As System.IO.Stream
Select Case r.Next(0, 3)
Case 0
s = My.Resources.camera_shutter_click_02
@jz5
jz5 / html.xls
Last active August 1, 2016 12:39
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<table>
<tr>
<td>あいうえお</td>
<td>かきくけこ</td>
</tr>
<Response>
<Say language="ja-JP">だるやなぎスピーチです。次のメッセージを発音してシャープキーを押しなさい。こんばんは</Say>
<Record action="http://example.jp/handler" finishOnKey="#"/>
</Response>
.panel {
background: url('http://pronama.azurewebsites.net/chrome/sd_eye0.png') no-repeat;
background-size: contain;
background-position: 10px -5px;
}
@jz5
jz5 / gist:7871343
Created December 9, 2013 12:10
描画先の範囲に合せて、画像の合成 左右・上下に空きがないよう、Web 画像を拡大・縮小して必要な範囲を描画します。
Dim dst = New Rectangle(754, 18, 1110, 807) ' 描画先の位置・大きさ
Dim src = New Rectangle(0, 0, webBmp.Width, webBmp.Height) ' 参照画像の位置・大きさ
If dst.Width / dst.Height < webBmp.Width / webBmp.Height Then
Dim w = dst.Width / (dst.Height / webBmp.Height)
src.X = Convert.ToInt32((webBmp.Width - w) / 2)
src.Width = Convert.ToInt32(w)
Else
Dim h = dst.Height / (dst.Width / webBmp.Width)
src.Y = Convert.ToInt32((webBmp.Height - h) / 2)
@jz5
jz5 / gist:7871405
Created December 9, 2013 12:16
CodeBehind -> CodeFile
<%@ Page Language="vb" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="GeneratorWebForm" %>
@jz5
jz5 / gist:7871437
Created December 9, 2013 12:19
QueryString
Dim q = Context.Request.QueryString.Get("q")
If Not Uri.IsWellFormedUriString(q, UriKind.Absolute) Then
Exit Sub
End If
Dim url = New Uri(q)
@jz5
jz5 / gist:7871310
Last active December 30, 2015 18:59
サーバーのディレクトリにある画像の読み込み
Dim wallBmp = New Bitmap(System.IO.Path.Combine(Server.MapPath("./"), "wallpaper.png"))
@jz5
jz5 / gist:7871317
Last active December 30, 2015 18:59
Content-Type image/png としてレスポンスを返す(画像の出力)
Response.ContentType = "image/png"
Response.Flush()
outBmp.Save(Response.OutputStream, Imaging.ImageFormat.Png)
Response.End()
@jz5
jz5 / gist:7871285
Created December 9, 2013 12:04
URL から Bitmap の生成
Dim webBmp As Bitmap
Using wc = New WebClient
webBmp = New Bitmap(wc.OpenRead(url))
End Using