赞 | 51 |
VIP | 35 |
好人卡 | 13 |
积分 | 81 |
经验 | 108654 |
最后登录 | 2024-7-9 |
在线时间 | 7346 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 8090
- 在线时间
- 7346 小时
- 注册时间
- 2010-7-16
- 帖子
- 4915
|
请问楼主这个和国外的这个脚本在功能上有什么区别?
国外这个也没有遮挡之类的问题。
原文链接:http://www.hbgames.org/forums/viewtopic.php?f=12&t=75650
module Graphics RtlMoveMemory = Win32API.new('kernel32', 'RtlMoveMemory', 'pii', 'i') BitBlt = Win32API.new('gdi32', 'BitBlt', 'iiiiiiiii', 'i') CreateCompatibleBitmap = Win32API.new('gdi32', 'CreateCompatibleBitmap', 'iii', 'i') CreateCompatibleDC = Win32API.new('gdi32', 'CreateCompatibleDC', 'i', 'i') DeleteObject = Win32API.new('gdi32', 'DeleteObject', 'i', 'i') GetDIBits = Win32API.new('gdi32', 'GetDIBits', 'iiiiipi', 'i') SelectObject = Win32API.new('gdi32', 'SelectObject', 'ii', 'i') SetDIBits = Win32API.new('gdi32', 'SetDIBits', 'iiiiipi', 'i') hWnd = Win32API.new('user32', 'FindWindow', 'pp', 'i').call('RGSS Player', 0) DC = Win32API.new('user32', 'GetDC', 'i', 'i').call(hWnd) def self.snap_to_bitmap bitmap = Bitmap.new(width=640, height=480) RtlMoveMemory.call(address="\0"*4, bitmap.__id__*2+16, 4) RtlMoveMemory.call(address, address.unpack('L')[0]+8, 4) RtlMoveMemory.call(address, address.unpack('L')[0]+16, 4) address = address.unpack('L')[0] info = [40,width,height,1,32,0,0,0,0,0,0].pack('LllSSLLllLL') hDC = CreateCompatibleDC.call(DC) hBM = CreateCompatibleBitmap.call(DC, width, height) DeleteObject.call(SelectObject.call(hDC, hBM)) SetDIBits.call(hDC, hBM, 0, height, address, info, 0) BitBlt.call(hDC, 0, 0, width, height, DC, 0, 0, 0xCC0020) GetDIBits.call(hDC, hBM, 0, height, address, info, 0) DeleteObject.call(hBM) DeleteObject.call(hDC) bitmap end end
module Graphics
RtlMoveMemory = Win32API.new('kernel32', 'RtlMoveMemory', 'pii', 'i')
BitBlt = Win32API.new('gdi32', 'BitBlt', 'iiiiiiiii', 'i')
CreateCompatibleBitmap = Win32API.new('gdi32', 'CreateCompatibleBitmap', 'iii', 'i')
CreateCompatibleDC = Win32API.new('gdi32', 'CreateCompatibleDC', 'i', 'i')
DeleteObject = Win32API.new('gdi32', 'DeleteObject', 'i', 'i')
GetDIBits = Win32API.new('gdi32', 'GetDIBits', 'iiiiipi', 'i')
SelectObject = Win32API.new('gdi32', 'SelectObject', 'ii', 'i')
SetDIBits = Win32API.new('gdi32', 'SetDIBits', 'iiiiipi', 'i')
hWnd = Win32API.new('user32', 'FindWindow', 'pp', 'i').call('RGSS Player', 0)
DC = Win32API.new('user32', 'GetDC', 'i', 'i').call(hWnd)
def self.snap_to_bitmap
bitmap = Bitmap.new(width=640, height=480)
RtlMoveMemory.call(address="\0"*4, bitmap.__id__*2+16, 4)
RtlMoveMemory.call(address, address.unpack('L')[0]+8, 4)
RtlMoveMemory.call(address, address.unpack('L')[0]+16, 4)
address = address.unpack('L')[0]
info = [40,width,height,1,32,0,0,0,0,0,0].pack('LllSSLLllLL')
hDC = CreateCompatibleDC.call(DC)
hBM = CreateCompatibleBitmap.call(DC, width, height)
DeleteObject.call(SelectObject.call(hDC, hBM))
SetDIBits.call(hDC, hBM, 0, height, address, info, 0)
BitBlt.call(hDC, 0, 0, width, height, DC, 0, 0, 0xCC0020)
GetDIBits.call(hDC, hBM, 0, height, address, info, 0)
DeleteObject.call(hBM)
DeleteObject.call(hDC)
bitmap
end
end
|
|