Skip to content

FLIP


切换当前视频显示页面

语法

declare function Flip ( byval frompage as long = -1, byval topage as long = -1 ) as long

用法

Flip [ frompage ] [, topage ]

参数

frompage

前一个页面

topage

要显示的新页面

返回值

成功时返回零(0),失败时返回非零错误代码。

说明

在普通图形模式下,FlipPCopyScreenCopy 的别名。详情参见 ScreenCopy

OpenGL 模式下,Flip 执行硬件页面翻转并显示后备缓冲区的内容。建议在 OpenGL 模式下定期调用 Flip,否则应用程序可能也会无响应。

Flip 返回的错误代码可以在下一行使用 Err 检查。Flip 的函数版本直接将错误代码作为 32 位 Long 返回。

示例

start GeSHi

vb
ScreenRes 320, 240, 32, 2    'Sets up the screen to be 320x240 in 32-bit color with 2 video pages.
ScreenSet 1,0                'Sets the working page to 1 and the displayed page to 0

For n As Integer = 50 To 270

    Cls
    Circle (n, 50),50 ,RGB(255,255,0) 'Draws a circle with a 50 pixel radius in yellow on page 1
    Flip 1,0    'Copies our circle from page 1 to page 0

    Sleep 25
Next

Print "Now wasn't that neat!"
Print "Push any key."
Flip 1,0    'Copies our text from page 1 to page 0
Sleep

end GeSHi

方言差异

  • -lang qb 方言中不可用,除非使用别名 __Flip 引用。

与 QB 的区别

  • FreeBASIC 新增

返回 目录

基于 FreeBASIC 官方文档翻译 如有侵权请联系我们删除
FreeBASIC 是开源项目,与微软公司无隶属关系