| 赞 | 3 |
| VIP | |
| 好人卡 | |
| 积分 | 4 |
| 经验 | |
| 最后登录 | 2025-4-27 |
| 在线时间 | 1196 小时 |
虚構歪曲
- 梦石
- 0
- 星屑
- 354
- 在线时间
- 1196 小时
- 注册时间
- 2010-12-18
- 回帖
- 3842

|
发表于 2011-3-6 11:33:26
|
显示全部楼层
本帖最后由 忧雪の伤 于 2011-3-6 14:27 编辑
全屏幕的bitmap,
再调用blur算法。- @xxx = Bitmap.new(640, 480)
- @xxx.blur
复制代码- class Bitmap
- # 模糊算法
- def blur(str = 3, rect = Rect.new(0, 0, self.width, self.height))
- if str < 1
- str = 1
- elsif str > 5
- str = 5
- end
- for x in -str..str
- for y in -str..str
- next if x == 0 and y == 0
- self.blt(x + rect.x, y + rect.y, self, Rect.new(rect.x, rect.y, rect.width - x, rect.height - y), 10)
- end
- end
- end
- end
复制代码 模糊算法不需要吧…… |
|