iron
Path : sample\iron , sample\iron\wasm_shared
sample_7z.hsp
title "iron_7z sample"
screen 0, 720, 560
font "MS Gothic", 12
mes " = iron_7z (hsp7z.dll + 7za) サンプル ="
mes ""
1.
sample\iron\sample_7z.hsp - 2026/04/15
sample_ai.hsp
#include "hsp3_net_64.as"
#include "iron_ai.hsp"
title "iron_ai サンプル ? ローカル LLM チャット"
screen 0, 720, 540
font "MS Gothic", 14
-- 初期設定 --
デフォルトは Ollama 想定 (key 不要)
iron_ai_set_endpoint "http: localhost:11434/v1"
iron_ai_set_model "llama3.2"
sample\iron\sample_ai.hsp - 2026/04/15
sample_ble.hsp
title "BLE sample"
screen 0, 900, 600
font "MS Gothic", 14
iron_ble_init
mes "ble_init stat=" + stat
iron_ble_scan_start
mes "scanning... (5 sec)"
5 秒間スキャン。
sample\iron\sample_ble.hsp - 2026/04/15
sample_cam_ai.hsp
sample_cam_ai.hsp ? Webcam スナップショット → AI 画像認識 → 説明文
IronHSP 2026 の目玉デモ。
sample\iron\sample_cam_ai.hsp - 2026/04/15
sample_camera_mf.hsp
iron_camera_mf サンプル: pure Media Foundation Webcam Preview
hspmfcam.dll (C++) → MF SourceReader → child window thread の
経路で Webcam をリアルタイム表示。OpenCV 不要、依存は hspmfcam.dll のみ。
sample\iron\sample_camera_mf.hsp - 2026/04/15
sample_camera_mf_dual.hsp
title "iron_camera_mf ? 2 cameras simultaneous preview"
n_cams = iron_cam_count()
if n_cams = 0 {
dialog "Webcam が接続されていません。
sample\iron\sample_camera_mf_dual.hsp - 2026/04/15
sample_camera_preview.hsp
title "iron_camera ? Webcam リアルタイムプレビュー"
カメラを開く
iron_camera_open 0
if stat = 0 {
iron_camera_size cw, ch
} else {
dialog "カメラ 0 を開けませんでした。\nWebcam が接続されているか確認してください。
sample\iron\sample_camera_preview.hsp - 2026/04/15
sample_clip.hsp
#include "hsp3cl_net_64.as"
#include "iron_clip.hsp"
mes " = iron_clip サンプル ="
mes ""
現在のクリップボード状態
if clip_has_text() {
mes "現在クリップボードにはテキストがあります"
clip_get_text
mes " 内容: " + refstr
mes " サイズ: " + stat + " 文字"
} else {
mes
sample\iron\sample_clip.hsp - 2026/04/15
sample_csv.hsp
title "iron_csv demo"
screen 0, 640, 480
font "MS Gothic", 14
1.
sample\iron\sample_csv.hsp - 2026/04/15
sample_designer.hsp
title "iron_designer PoC"
screen 0, 1200, 800
cls 4
sdim s_code, 32768
上段 70% をデザイナ、下段 30% をコード表示
designer_init 0, 8, 8, 1184, 520
did = stat
if did < 0 {
mes "designer_init 失敗: " + did
stop
}
pos 8, 536
mes "↓ 「コード出力」ボタンで生成された HSP
sample\iron\sample_designer.hsp - 2026/04/15
sample_dialog.hsp
#include "hsp3_net_64.as"
#include "iron_dialog.hsp"
mes "iron_dialog サンプル ? モダンファイルダイアログ"
mes ""
mes "[1] 開くダイアログ"
mes "[2] 保存ダイアログ"
mes "[3] フォルダ選択ダイアログ"
mes "[ESC] 終了"
mes ""
onkey gosub *on_key
stop
*on_key
if iparam = 27 : end
sample\iron\sample_dialog.hsp - 2026/04/15
sample_duckdb.hsp
title "hspduckdb sample"
screen 0, 800, 600
font "MS Gothic", 14
pos 8, 8
mes "hspduckdb sample"
mes " ="
mes ""
1) in-memory DB を open
db_open ":memory:"
db = stat
if db < 0 {
mes "open failed: " + db
mes "(duckdb amalgamation
sample\iron\sample_duckdb.hsp - 2026/04/15
sample_hash.hsp
#include "hsp3cl_net_64.as"
#include "iron_hash.hsp"
mes " = ハッシュサンプル ="
mes ""
文字列のハッシュ
hash_md5 "hello world" : mes "MD5 : " + refstr
hash_sha1 "hello world" : mes "SHA-1 : " + refstr
hash_sha256 "hello world" : mes "SHA-256: " + refstr
sample\iron\sample_hash.hsp - 2026/04/15
sample_http_get.hsp
#include "hsp3cl_net_64.as"
#include "iron_http.hsp"
タイムアウトを長めに (デフォルト 30 秒)
http_set_timeout 30
url = "https: api.open-meteo.com/v1/forecast?latitude=35.68&longitude=139.69¤t=temperature_2m,wind_speed_10m"
mes "GET " + url
mes ""
sample\iron\sample_http_get.hsp - 2026/04/15
sample_ini_config.hsp
#include "hsp3_net_64.as"
#include "iron_ini.hsp"
カレントディレクトリを起点にした絶対パスで ini を開く
ini_setpath "sample_config.ini"
-- 設定読み込み (デフォルト値付き) --
ini_geti "Window", "Width", 640 : w = stat
ini_geti "Window", "Height", 480 : h = stat
ini_getd "View",
sample\iron\sample_ini_config.hsp - 2026/04/15
sample_json.hsp
#include "hsp3cl_net_64.as"
#include "iron_json.hsp"
-- パース対象の JSON --
json = {"
{
"name": "Alice",
"age": 30,
"active": true,
"score": 92.5,
"tags": ["admin", "user", "guest"],
"address": {
"city": "Tokyo",
"zip": "100-0001"
}
}
"}
sample\iron\sample_json.hsp - 2026/04/15
sample_llama.hsp
title "hspllama sample"
screen 0, 720, 480
font "MS Gothic", 14
mes "local LLM 推論デモ (llama.cpp)"
mes ""
llama_init
mes "backend init OK"
モデルロード (n_ctx=2048, GPU offload=0)
llama_load "Llama-3.2-3B-Instruct-Q4_K_M.gguf", 2048, 0, h
if h <
sample\iron\sample_llama.hsp - 2026/04/15
sample_mcp_client.hsp
title "iron_mcp_client sample"
screen 0, 800, 600
font "MS Gothic", 14
mes " = MCP client sample ="
mes ""
公式 filesystem server を ./temp を root にして spawn
cmd = "npx -y @modelcontextprotocol/server-filesystem " + dirinfo(0)
mes "spawning: " +
sample\iron\sample_mcp_client.hsp - 2026/04/15
sample_mcp_server.hsp
#include "hsp3cl_net_64.as"
#include "iron_mcp_server.hsp"
-- ツール登録 --
iron_mcp_server_tool "say_hello", "Say hello to a name (arg: name=string)", *handler_hello
iron_mcp_server_tool "add", "Add two integers (args: a=int, b=int)", *handler_add
sample\iron\sample_mcp_server.hsp - 2026/04/15
sample_mediapipe_hand.hsp
title "MediaPipe Hand Detection (IronHSP)"
screen 0, 800, 600
画像読み込み
picload "mediapipe_models/hand.jpg"
src_w = ginfo_winx
src_h = ginfo_winy
bmscr から 24bit DIB を取得
mref bm, 67
sdim bgr, src_w * src_h * 3
memcpy bgr, bm, src_w * src_h
sample\iron\sample_mediapipe_hand.hsp - 2026/04/15
sample_mic_record.hsp
#include "hsp3_net_64.as"
#include "iron_camera_mf.hsp"
#include "iron_speech.hsp"
title "sample_mic_record ? マイク録音 + 文字起こし"
screen 0, 720, 540
font "MS Gothic", 14
-- マイクデバイス列挙 --
mes " = マイク録音 + 文字起こしデモ ="
mes ""
n_mic =
sample\iron\sample_mic_record.hsp - 2026/04/15
sample_midi.hsp
title "iron_midi ? sample"
screen 0, 480, 240
font "MS Gothic", 14
color 0, 0, 0
mes "hspmidi.dll ? C major scale demo"
mes ""
デバイス列挙
ndev = 0
midi_out_count ndev
mes strf("MIDI out devices: %d", ndev)
if ndev == 0 {
color 180, 0, 0
sample\iron\sample_midi.hsp - 2026/04/15
sample_office.hsp
title "iron_office sample"
screen 0, 800, 600
font "MS Gothic", 14
pos 8, 8
mes "iron_office sample"
mes " "
mes ""
1) 既存 xlsx のセル A1 を読む
mes "[1] office_excel_get_cell で A1 を読む"
office_excel_get_cell "test_out.xlsx", 1, 1, 1, v
mes
sample\iron\sample_office.hsp - 2026/04/15
sample_onnx.hsp
title "hsponnx sample"
screen 0, 720, 480
font "MS Gothic", 14
mes "ONNX Runtime 推論デモ"
mes ""
iron_onnx_open "model.onnx"
h = stat
if h < 0 {
mes "onnx_load_model に失敗しました (code=" + h + ")"
mes "model.onnx を配置していますか?"
mes "また
sample\iron\sample_onnx.hsp - 2026/04/15
sample_pdf.hsp
title "hsppdf sample"
screen 0, 900, 720
font "MS Gothic", 14
PDFium 初期化
pdf_begin
ファイル選択
path = "sample.pdf"
exist path
if strsize < 0 {
dialog "pdf", 16, "PDF ファイルを選択"
if stat == 0 { dialog "キャンセルされました" : goto *done }
path = refstr
sample\iron\sample_pdf.hsp - 2026/04/15
sample_perf.hsp
#include "hsp3_net_64.as"
#include "iron_perf.hsp"
mes " = iron_perf サンプル ="
mes ""
パフォーマンス周波数
perf_freq
mes "QueryPerformanceFrequency: " + refdval + " Hz"
mes ""
ベンチマーク 1: 100 万回 cnt 加算
perf_start
repeat 1000000
dummy = cnt * 2 + 1
sample\iron\sample_perf.hsp - 2026/04/15
sample_player.hsp
title "HSP 簡易メディアプレイヤー"
screen 0, 600, 440
font "MS Gothic", 14
sdim filepath, 1024
filepath = "C:\\Windows\\Media\\Alarm01.wav"
sdim alias_name, 32
alias_name = "media"
opened = 0
is_video = 0
vol = 800
UI 配置
pos 10, 10
mes
sample\iron\sample_player.hsp - 2026/04/15
sample_ribbon.hsp
title "iron_ribbon demo"
screen 0, 1000, 600
cls 4
sdim s_log, 8192
sdim bid, 128
dark = 0
リボンを上端に貼る
ribbon_init 0, 0, 0, 1000, 138
rid = stat
if rid < 0 {
mes "ribbon_init 失敗: " + rid
stop
}
タブ
ribbon_add_tab rid, "ファイル", "file"
sample\iron\sample_ribbon.hsp - 2026/04/15
sample_ruffle.hsp
#include "hsp3_net_64.as"
#include "iron_ruffle.hsp"
title "iron_ruffle demo"
screen 0, 960, 720
cls 4
sdim s_path, 1024
sdim s_log, 2048
s_path = "movies/hello.swf"
objsize 120, 28
pos 8, 8
button gosub "SWF 選択", *on_pick
pos 140, 8
sample\iron\sample_ruffle.hsp - 2026/04/15
sample_speech.hsp
#include "hsp3_net_64.as"
#include "iron_speech.hsp"
title "iron_speech sample"
screen 0, 720, 540
font "MS Gothic", 14
mes " = iron_speech (cloud whisper) sample ="
mes ""
-- バックエンド選択 --
iron_speech_set_backend SPEECH_BACKEND_CLOUD
mes
sample\iron\sample_speech.hsp - 2026/04/15
sample_sysinfo.hsp
#include "hsp3cl_net_64.as"
#include "iron_sysinfo.hsp"
mes " = iron_sysinfo サンプル ="
mes ""
sys_username : mes "ユーザー名 : " + refstr
sys_computername : mes "コンピュータ名 : " + refstr
sys_cpucount : mes "CPU コア数 : " + stat
sys_pagesize : mes "ページサイズ
sample\iron\sample_sysinfo.hsp - 2026/04/15
sample_toast.hsp
#include "hsp3_net_64.as"
#include "iron_toast.hsp"
mes " = iron_toast サンプル ="
mes ""
mes "3 種類の通知を 2 秒おきに順番に表示します。
sample\iron\sample_toast.hsp - 2026/04/15
sample_toast_winrt.hsp
title "iron_toast_winrt sample" screen 0, 520, 420 font "MS Gothic", 14 mes " = モダン Toast (WinRT) デモ =" mes "" アプリ識別情報 APP_DISPNAME = "IronHSP Toast Sample" APP_ID = "IronHSP.Sample.ToastWinRT" toast_winrt_init APP_DISPNAME, APP_ID if stat < 0 {
sample\iron\sample_toast_winrt.hsp - 2026/04/15
sample_video_player.hsp
title "iron_video ? Media Foundation Player"
screen 0, 800, 600
font "MS Gothic", 14
loaded = 0
rate_idx = 1 0=0.5x 1=1.0x 2=1.5x 3=2.0x
vol_int = 80 0-100
-- UI --
pos 10, 10
objsize 80, 28
button gosub "Open", *do_open
pos 100, 10
sample\iron\sample_video_player.hsp - 2026/04/15
sample_video_player2.hsp
title "iron_video Player ? シークバー付き"
screen 0, 900, 680
font "MS Gothic", 14
loaded = 0
vol_int = 80
rate_idx = 2 0:0.5x 1:0.75x 2:1.0x 3:1.25x 4:1.5x 5:2.0x
-- UI --
pos 10, 10
objsize 80, 28
button gosub "Open", *do_open
pos 100, 10
sample\iron\sample_video_player2.hsp - 2026/04/15
sample_wasm.hsp
#include "hsp3_net_64.as"
#include "iron_wasm.hsp"
title "hspwasm sample"
screen 0, 640, 400
font "MS Gothic", 14
wasm_open "add.wasm"
h = stat
if h < 0 {
mes "wasm_open に失敗しました (code=" + h + ")"
mes "add.wasm が見つからないか、壊れている可能性があります。
sample\iron\sample_wasm.hsp - 2026/04/15
sample_weather.hsp
#include "hsp3cl_net_64.as"
#include "iron_http.hsp"
#include "iron_json.hsp"
パラメータ
lat = "35.68"
lon = "139.69"
url = "https: api.open-meteo.com/v1/forecast?latitude=" + lat + "&longitude=" + lon +
sample\iron\sample_weather.hsp - 2026/04/15
sample_webpdf.hsp
title "iron_webpdf demo"
screen 0, 720, 520
cls 4
font "MS Gothic", 14
sdim s_html, 8192
sdim s_log, 4096
-- サンプル HTML を組み立て --
s_html = {"<!DOCTYPE html>
<html><head><meta charset='utf-8'><title>Invoice</title>
<style>
body { font-family:
sample\iron\sample_webpdf.hsp - 2026/04/15
sample_webserver.hsp
title "iron_webserver sample (localhost:8080)"
screen 0, 720, 480
font "MS Gothic", 14
mes " = iron_webserver サンプル ="
mes ""
web_open 8080
if stat < 0 {
mes "[error] ポート 8080 が既に使用中の可能性"
stop
}
mes "http: localhost:8080/ で HTTP サーバ開始"
sample\iron\sample_webserver.hsp - 2026/04/15
sample_websocket.hsp
title "iron_webserver WebSocket echo demo"
screen 0, 720, 540
font "MS Gothic", 14
mes " = HSP WebSocket Echo Server ="
mes ""
mes "http: localhost:8080/ で HTTP/WebSocket サーバ開始"
mes "ブラウザで上記 URL を開いてください"
mes "ESC キーで終了"
mes ""
mes " -- ログ
sample\iron\sample_websocket.hsp - 2026/04/15
sample_webview2.hsp
#include "hspwebview2.as" している)。
sample\iron\sample_webview2.hsp - 2026/04/15
sample_webview2_bridge.hsp
title "iron_webview2 bridge demo (HSP <-> JS)"
screen 0, 960, 720
cls 4
-- UI --
objsize 120, 28
pos 8, 8
button gosub "送信", *on_send
pos 140, 8
input s_in, 500, 24
pos 8, 520
mesbox s_log, 944, 192
sdim s_in, 2048
sdim s_log, 8192
sample\iron\sample_webview2_bridge.hsp - 2026/04/15
sample_wgcapture.hsp
title "WGCapture sample"
screen 0, 800, 400
font "MS Gothic", 14
iron_wgc_init
if stat {
mes "wgc_init failed stat=" + stat
stop
}
mes "wgc_init OK"
プライマリモニタ全体 (index 0) をキャプチャ
iron_wgc_start_monitor 0
handle = stat
if handle < 0 {
sample\iron\sample_wgcapture.hsp - 2026/04/15
sample_winrtocr.hsp
title "WinRT OCR sample"
screen 0, 800, 600
font "MS Gothic", 14
objmode 2
利用可能な OCR 言語をまず表示
ocr_langs langs
mes "[Available OCR languages]"
mes langs
mes ""
OCR エンジン初期化 (ユーザー言語で auto 選択)
ocr_init
if stat {
mes "ocr_init failed (stat="
sample\iron\sample_winrtocr.hsp - 2026/04/15
sample_xlsx.hsp
title "iron_xlsx sample"
screen 0, 800, 600
font "MS Gothic", 14
pos 8, 8
color 0, 0, 0
1) 新規作成 → 値を入れて保存
mes "[1] xlsx_new で新規 book を作成"
xlsx_new h_new
if h_new < 0 {
mes " xlsx_new failed"
stop
}
xlsx_set_cell h_new, 0, 1, 1,
sample\iron\sample_xlsx.hsp - 2026/04/15
sample_wasm_shared.hsp
sample_wasm_shared.hsp
同じ shared.wasm を HSP とブラウザ両方から呼んで
結果が一致することを確認するデモ。
sample\iron\wasm_shared\sample_wasm_shared.hsp - 2026/04/15