设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1867|回复: 3
打印 上一主题 下一主题

按键截图“Shift”

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-12-15
帖子
97
跳转到指定楼层
1
发表于 2007-12-18 05:01:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-12-15
帖子
97
2
 楼主| 发表于 2007-12-18 05:01:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv4.逐梦者

梦石
0
星屑
8003
在线时间
1184 小时
注册时间
2007-7-29
帖子
2057
3
发表于 2007-12-18 05:06:45 | 只看该作者
请在主站上搜索:截图
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
142
在线时间
264 小时
注册时间
2006-11-22
帖子
1057
4
发表于 2007-12-18 06:05:15 | 只看该作者
  1. #============================================================================== #
  2. # Screenshot V2
  3. #
  4. # Screenshot Script v1 & screenshot.dll v1            created by: Andreas21
  5. # Screenshot Script v2                                created/edit by: cybersam
  6. # the autor is found on a german board...
  7. # the comments are added by me...
  8. # since the autor didnt want to add any comment...
  9. # so thats it from here...
  10. # have fund with it... ^-^
  11. #
  12. # oh yea.. the needed command line is found in "Scene_Map" in "def update"
  13. #
  14. #===============================================================================
  15. module Screen  
  16.   @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
  17.   @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
  18.   @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
  19.   module_function
  20.   #-----------------------------------------------------------------------------
  21.   # here comes the stuff...
  22.   # i add here the stuff for automatic change of the number for the screenshot
  23.   # so it wont overrite the old one...
  24.   # if you want to change so stuff change them in this line below
  25.   # or you can change them in your command line... like
  26.   # Screen::shot("screenshot", 2)
  27.   # this change the name and the type of the screenshot
  28.   # (0 = bmp, 1 = jpg and 2 = png)
  29.   # ----------------------------------------------------------------------------
  30.   def shot(file = "screenshot", typ = 2)
  31.     # to add the right extension...
  32.     if typ == 0
  33.       typname = ".bmp"
  34.     elsif typ == 1
  35.       typname = ".jpg"
  36.     elsif typ == 2
  37.       typname = ".png"
  38.     end   
  39.     file_index = 0   
  40.     dir = ""   
  41.     # make the filename....
  42.     file_name = file.to_s + typname.to_s#dir + file.to_s + typname.to_s   
  43.     # make the screenshot.... Attention dont change anything from here on....
  44.     @screen.call(0,0,640,480,file_name,handel,typ)
  45.   end
  46.   # find the game window...
  47.   def handel
  48.     game_name = "\0" * 256
  49.     @readini.call('Game','Title','',game_name,255,".\\Game.ini")
  50.     game_name.delete!("\0")
  51.     return @findwindow.call('RGSS Player',game_name)
  52.   end
  53. end
复制代码
  1. #==============================================================================
  2. # ■ Graphics
  3. #------------------------------------------------------------------------------
  4. #  進行有關全體圖像處理的模塊。
  5. #==============================================================================

  6. class << Graphics
  7.   alias old_update update
  8.   #--------------------------------------------------------------------------
  9.   # ● 更新畫面
  10.   #--------------------------------------------------------------------------
  11.   def update
  12.     if Input.press?(Input::SHIFT)
  13.       timestamp = Time.now.strftime("%Y%m%d%H%M")
  14.       se = Time.now.sec
  15.       Screen::shot("#{timestamp}#{se}", 2)
  16.     end
  17.     old_update
  18.   end
  19. end
复制代码

系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2026-6-21 23:49

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表