在工业实时绘图中,当某一点出现异常,需要突出标示该点,我想用闪烁的效果,因为其他的方法,比如颜色变化,粗细变化都不是很明显(因为绘图区大量已经用了这些方法画网格和曲线)有没有方法能够实现? 实时曲线已经用一个时间控件控制了一般实现闪烁效果,都是用时间控件,改变颜色实现闪烁的有没有纯粹绘图方法实现闪烁的效果?

解决方案 »

  1.   

    循环
    do
      doevnets
    loop
      

  2.   

    可以采用变通的方法,创建一个光标:'On form1 place 2 textboxes (with a height for a couple of lines) and 1 picturebox.
    'Select a bitmap for the picturebox and set the autosize on true.
    Private Declare Function CreateCaret Lib "user32" (ByVal hwnd As Long, ByVal hBitmap As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
    Private Declare Function ShowCaret Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function GetFocus Lib "user32" () As Long
    Private Declare Function SetCaretPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
    Private Declare Function SetCaretBlinkTime Lib "user32" (ByVal wMSeconds As Long) As LongPrivate Sub Text2_GotFocus()
        'retrieve the window which has the focusEnd SubPrivate Sub Command1_Click()
        'h& = GetFocus&()
        'Create a new cursor
        Call CreateCaret(Me.hwnd, 0, 5, 5)
        SetCaretPos 30&, 30&
        'Show the new cursor
        SetCaretBlinkTime 100
        x& = ShowCaret&(h&)
    End Sub
      

  3.   

    点击command1就可以在Form1的30,30的位置创建一个闪烁的Caret。
      

  4.   

    如创建一个插入符,会同时清除原先的插入符;效果等同于DestroyCaret函数。冰儿马甲的方法虽然很有创意,但是对于我不是很适用,因为我必需知道当前插入符的位置
    管理起来也挺很麻烦的。