zoukankan      html  css  js  c++  java
  • Copying The Last Rendered Image To The Windows Clipboard

    The following example demonstrates the use of the System.Windows.Forms.Clipboard DotNetClass to read and write bitmaps from/to the Windows Clipboard.

    The script can be saved into one of the Startup folders to be evaluated on startup.
    The custom function will be executed by a PostRender callback each time the renderer finishes.

    fn CopyRenderToClipboard = --define a global function
    (
      clipboardClass = dotNetClass "System.Windows.Forms.Clipboard" --create a Clipboard dotNetClass
      b = getLastRenderedImage() --get the last saved image
      theFileName = GetDir #image + "\\_renderToClipboard.bmp" --define a temp.file name
      b.filename = theFileName --set the bitmap's file name
      save b --save the bitmap
      close b --close the bitmap
      theImage = dotNetClass "System.Drawing.Image" --create an Image dotNetClass
      theBitmap = theImage.FromFile theFileName --get the saved image from file as bitmap
      clipboardClass.setImage theBitmap --copy the image to clipboard
      theBitmap.Dispose() --release the bitmap
      deleteFile theFileName --delete the temp. file
      clipboardClass.ContainsImage() --return true if the clipboard contains image
    )--end fn

    callbacks.removeScripts id:#CopyRenderToClipboard --remove any callbacks with the given ID
    callbacks.addScript #PostRender "CopyRenderToClipboard()" id:#CopyRenderToClipboard --register a callback to run the function post-render
  • 相关阅读:
    socket的accept函数解析
    c socket(续)
    C socket指南
    网络字节序和本机字节序
    jar包
    RESTful API 设计指南[转]
    理解RESTful架构[转]
    c语言正则表达式
    Fedora设置中文
    创建框架结构的页面2
  • 原文地址:https://www.cnblogs.com/softimagewht/p/bobo.html
Copyright © 2011-2022 走看看