:Start of olepic <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN"> <html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>olepic.dsc</title><STYLE>BODY{FONT-SIZE: 12px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #ffffed } A{COLOR: Blue} A:active {FONT-WEIGHT: bold; COLOR: #008000} A:visited{FONT-WEIGHT: bold; COLOR: #400000} A:hover{ FONT-WEIGHT: bold; COLOR: #008000;} H1{COLOR: #400000; TEXT-ALIGN: left FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif} #copyright { border-top: 2px solid rgb(165, 82, 0); width: 100%; } DIV.left{TEXT-ALIGN: left} DIV.centered{TEXT-ALIGN: center}</STYLE></head><body bgcolor=#ffffed><table width="100%" height="133"><tr height="129"><th width="173"><a href = "http://www.dragonsphere.net" target = "_blank"><img style="Z-INDEX: 100; LEFT: 25px; POSITION: absolute; TOP: 40px" height="124" alt="DragonSphere" src="http://www.dragonsphere.net/images/dragonfly.png" width="169" align="left" border="0"></a></th><th><a href = "http://www.dragonsphere.net" target = "_blank"><img style="Z-INDEX: 100; LEFT: 200px; POSITION: absolute; TOP: 40px" height="124" alt="Software" src="http://www.dragonsphere.net/images/dslogotext.png" width="473" align="left" border="0"></a></th></tr></table><br/><!--

#DEFINE COMMAND,<!--
#DEFINE COMMAND,-->
<!-- This is crazy but now we should be able to see this script in the browser and run it in VDS too without changing the source code. --><h1>DragonSphere Software Demos</h1><br/><p>If you are viewing this script in your browser you can save it as a VDS 5.x source file (*.dsc) to run it.</p><br/><hr><br/><pre>
#
# <a href = "http://www.dragonsphere.net" target = "_blank">DragonSphere Software's Home Page</a>
#  
# <a href = "http://www.dragonsphere.net/products/gadgetx/demos/olepic.zip">All Source Files for this demo</a>
#
# This demo shows how to use the OLE Picture commands and functions
# 
Title Ole Picture View
If @Greater(@Name(@SYSINFO(DSVER)),4)
<!-- GadgetX --><a href = "http://www.dragonsphere.net/products/gadgetx/gadgetx.zip">
External GadgetX.dll,@SysInfo(DSVER)
<!-- GadgetX --></a>
  #DEFINE COMMAND,OLE,SET,DEFINE,SETWIN,FIREEVENT
  #DEFINE FUNCTION,OLE,GET,GETWIN,HIMETRICTOPIXEL,PIXELTOHIMETRIC,GETLASTERROR
Else
  Warn This demo was designed to work with@CR()VDS 5.x from http://www.dialogscript.com
  Stop
End
Define variable,Object,objbmp
Ole Init
%%ClassName = #OPV
  DIALOG CREATE,Ole Picture View,-1,0,640,480,CLASS OPV,PAINT,RESIZABLE
REM *** Modified by Dialog Designer on 10/24/2006 - 14:26 ***
  DIALOG ADD,MENU,&File,&Open,E&xit
  DIALOG ADD,STATUS,STATUS1,

  DIALOG SHOW
  Set objbmp,@Ole(Picture,Load,Morning Star.jpg)
  
:evloop
  wait event
  %E = @Event()
  If %E
    goto %E
  End
goto evloop

:OPENMENU
  %F = @filedlg("Image files (*.jpg, *.bmp, *.gif, *.ico)|*.jpg;*.bmp;*.gif;*.ico|All files (*.*)|*.*",Choose an Image) 
  If @Ok()
    if @Get(objbmp)
      Ole Free,Object,objbmp
    end
    Set objbmp,@Ole(Picture,Load,%F)
    SetWin Background,UPDATE,%%ClassName
    
  End
goto evloop

:RESIZE
:PAINT
  If @Get(objbmp)
    %%hmWidth = @Ole(Picture,Width,objbmp)
    %%hmHeight = @Ole(Picture,Height,objbmp)
    %%PixWidth = @HiMetricToPixel(X,%%hmWidth)
    %%PixHeight = @HiMetricToPixel(Y,%%hmHeight)
    %%HDC = @GetWin(HDC,CLIENT,%%ClassName)
    Ole Picture,Render,objbmp,%%HDC,0,0,%%PixWidth,%%PixHeight,0,%%hmHeight,%%hmWidth,-%%hmHeight
    
    SetWin HDC,Released,%%ClassName,%%HDC
    Dialog SetPos,,,,%%PixWidth,@Sum(%%PixHeight,20)
    Dialog Set,STATUS1,HMWidth = %%hmWidth HMHeight = %%hmHeight PixWidth = %%PixWidth PixHeight = %%PixHeight
  End
goto evloop

:EXITMENU
:CLOSE
  if @Get(objbmp)
    Ole Free,Object,objbmp
  end
  Ole UnInit
Exit

<!-- This is crazy but now we should be able to see this script in the browser. --></pre><div id="copyright"><p>copyright &copy; DragonSphere Software 2000-2006<br><a href="http://www.dragonsphere.net/terms.html" target="_blank">Terms and Conditions</a></p></div></body></html><!--
:-->
:<!--
  
Exit 
# -->End of olepic
