Project1

标题: 【应求脚本】vx用一键截图(xp改造) [打印本页]

作者: 柳之一    时间: 2008-8-1 23:21
标题: 【应求脚本】vx用一键截图(xp改造)
原问题:

http://rpg.blue/viewthread.php?tid=96611

效果:按f5,可以截图,保存在Graphics/Pictures/下面

使用方法:将脚本插在Scene_Map之后,main之前,并把下面连接中的dll解压在你的游戏文件夹内即可。




  1. #===============================================================================
  2. #
  3. # Screenshot V2
  4. #
  5. # Screenshot Script v1 & screenshot.dll v1            created by: Andreas21
  6. # Screenshot Script v2                                created/edit by: cybersam
  7. # the autor is found on a german board...
  8. # the comments are added by me...
  9. # since the autor didnt want to add any comment...
  10. # so thats it from here...
  11. # have fund with it... ^-^
  12. #
  13. # oh yea.. the needed command line is found in "Scene_Map" in "def update"
  14. #
  15. #===============================================================================
  16. module Screen
  17.   ##
  18.   ##
  19.   @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
  20.   @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
  21.   @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
  22.   module_function
  23.   #-----------------------------------------------------------------------------
  24.   # here comes the stuff...
  25.   # i add here the stuff for automatic change of the number for the screenshot
  26.   # so it wont overrite the old one...
  27.   # if you want to change so stuff change them in this line below
  28.   # or you can change them in your command line... like
  29.   # Screen::shot("screenshot", 2)
  30.   # this change the name and the type of the screenshot
  31.   # (0 = bmp, 1 = jpg and 2 = png)
  32.   # ----------------------------------------------------------------------------
  33.   def shot(file = "screenshot", typ = 2)
  34.     # to add the right extension...
  35.     if typ == 0
  36.       typname = ".bmp"
  37.     elsif typ == 1
  38.       typname = ".jpg"
  39.     elsif typ == 2
  40.       typname = ".png"
  41.     end   
  42.     file_index = 0   
  43.     dir = "Graphics/Pictures/"     
  44.     # make the filename....
  45.     file_name = dir + file.to_s + typname.to_s
  46.     # make the screenshot.... Attention dont change anything from here on....
  47.     @screen.call(0,0,544,416,file_name,handel,typ)
  48.   end
  49.   # find the game window...
  50.   def handel
  51.     game_name = "\0" * 256
  52.     @readini.call('Game','Title','',game_name,255,".\\Game.ini")
  53.     game_name.delete!("\0")
  54.     return @findwindow.call('RGSS Player',game_name)
  55.   end
  56. end

  57. class Scene_Map < Scene_Base
  58.   #--------------------------------------------------------------------------
  59.   # ● 开始处理
  60.   #--------------------------------------------------------------------------
  61.   def update
  62.     super
  63.     $game_map.interpreter.update      # 更新解释器
  64.     $game_map.update                  # 更新滴入
  65.     $game_player.update               # 更新玩家
  66.     $game_system.update               # 更新计时器
  67.     @spriteset.update                 # 更新活动块元件
  68.     @message_window.update
  69.     # 更新消息窗口
  70.     unless $game_message.visible      # 正在显示消息以外的情况
  71.       update_transfer_player
  72.       update_encounter
  73.       update_call_menu
  74.       update_call_debug
  75.       update_scene_change
  76.     end
  77.     if Input.press?(Input::F5)
  78.       Screen::shot
  79.     end
  80.   end
  81. end  
复制代码


http://rpg.blue/UP_PIC/200801/screenshot_98032718.rar



作者: 沉影不器    时间: 2008-8-1 23:54
提示: 作者被禁止或删除 内容自动屏蔽
作者: 星辰天羽    时间: 2008-8-2 00:18
以下引用沉影不器于2008-8-1 15:54:15的发言:

真奇怪...
换做别人也就算了,楼主竟然会用screenshot.dll保存截图


XP的时候都是这样啊!!
作者: RXVincent    时间: 2008-8-2 01:08
VX可以用LZ发布的Marshal屏幕储存来截屏,所以才说LZ用sceenshot很奇怪。
作者: 越前リョーマ    时间: 2008-8-2 03:21
偷懒专用…… = =
作者: 幻獬豸    时间: 2008-8-4 23:23
提示: 作者被禁止或删除 内容自动屏蔽
作者: yangff    时间: 2008-8-5 02:59
lz为什么会。。。
Graphics.snap_to_bitmap (RGSS2)
Gets the current game screen image as a bitmap object.

This reflects the graphics that should be displayed, without relation to use of the freeze method.

The created bitmap must be freed when it is no longer needed.


作者: yangff    时间: 2008-8-5 03:03
http://rpg.blue/viewthread.php?tid=75512

这个里面就有
作者: 御灵    时间: 2008-8-8 03:24
http://rpg.blue/web/htm/news1141.htm
vip+2




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1