[Top Page][All Pages][Recent Changes]

Edit History:Diff

Changes of 画像表示 between Epoch and 2012/05/28 14:18:06 JST

  • + added lines
  • - deleted lines

Return to the edit history

+ 画像を表示する
+ 
+ 
+ [[$$toc]]
+ - →[[HSP3・サンプルスクリプト]]に戻る
+ ----
+ IE9へバージョンアップすると mod_img.as が使えなくなってしまい残念に思っていました。~%
+ a2d.hspで良いのでは?って話なんですが、代わりになるコンポーネントを見つけてきました。~%
+ モジュール化はしてません。
+ 
+ * スクリプト
+ 
+ {{{
+ // PNGのアルファチャンネルもOK
+ // IShellImageDataFactoryというコンポーネントを使用
+ // 使用DLLはShell32.dll
+ // OSに依存する。[ WindowsXP以降 (WIN8cpでも使えた。) ]
+ 
+ #define IID_IShellImageDataFactory  "{9be8ed5c-edab-4d75-90f3-bd5bdbb21c82}"
+ #define CLSID_ShellImageDataFactory "{66e4e4fb-f385-4dd0-8d74-a2efd1bc6178}"
+ 
+ #usecom IShellImageDataFactory IID_IShellImageDataFactory CLSID_ShellImageDataFactory
+ #comfunc _CreateImageFromFile 4 wstr,int
+ 
+ #usecom IShellImageData "{bfdeec12-8040-4403-a5ea-9e07dafcf530}"
+ #comfunc _Decode     3 int,int,int
+ #comfunc _Draw       4 int,int,int
+ #comfunc _GetSize   18 int
+ 
+ #define  SHIMGDEC_DEFAULT    0x00000000
+ #define  SHIMGDEC_THUMBNAIL  0x00000001
+ #define  SHIMGDEC_LOADFULL   0x00000002
+ 
+ onexit *exit
+ 
+ screen 1
+ 
+ cls 4
+ dialog "png|bmp|jpg|jpeg|gif|tiff",16,""
+ path=""+refstr
+ 
+ newcom pshell,IShellImageDataFactory
+ 
+ newcom pdata
+ _CreateImageFromFile pshell,path,varptr(pdata)
+ 
+ _Decode pdata,SHIMGDEC_DEFAULT,0,0
+ 
+ dim size,2
+ _GetSize pdata,varptr(size)
+ 
+ dim rect1,4
+ dim rect2,4
+ 
+ rect1=0,0,size(0),size(1)
+ rect2=0,0,size(0),size(1)
+ 
+ _Draw pdata,hdc,varptr(rect1),varptr(rect2)
+ redraw
+ 
+ title "読み込み完了["+path+"]"
+ delcom pdata : pdata=0
+ delcom pshell : pshell=0
+ 
+ screen 0
+ picload "sky_bg.jpg",0 //背景は適当に
+ gmode 2
+ gcopy 1,0,0,size(0),size(1)
+ stop
+ 
+ *exit
+ end
+ 
+ }}}