Click here to Skip to main content
15,918,889 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Differentiate form close event Pin
nishkarsh_k15-May-08 3:32
nishkarsh_k15-May-08 3:32 
GeneralRe: Differentiate form close event Pin
mr_lasseter15-May-08 4:05
mr_lasseter15-May-08 4:05 
GeneralRe: Differentiate form close event Pin
nlarson1115-May-08 4:07
nlarson1115-May-08 4:07 
AnswerRe: Differentiate form close event Pin
helelark12315-May-08 4:48
helelark12315-May-08 4:48 
AnswerRe: Differentiate form close event Pin
nishkarsh_k15-May-08 19:05
nishkarsh_k15-May-08 19:05 
QuestionLive Broadcast on web using Windows Media Encoder SDK Pin
xavier198815-May-08 2:29
xavier198815-May-08 2:29 
AnswerRe: Live Broadcast on web using Windows Media Encoder SDK Pin
Thomas Stockwell19-May-08 8:23
professionalThomas Stockwell19-May-08 8:23 
QuestionFlickering Problem in Text Control Pin
Soumya9215-May-08 2:05
Soumya9215-May-08 2:05 
As part of a presentation software, I decided to write a custom control that provides cool text effects (like in powerpoint 2007). To support transparency, I used Bob Powell's code. Everything is fine in the designer, but when I try to animate the control, it flickers a lot. Double buffering just gives it a black background. Can anyone help me remove the flicker?

The code for the class:

Imports System.Drawing.Drawing2D

Public Class Text2007
    Inherits System.Windows.Forms.UserControl

    Protected Overrides ReadOnly Property CreateParams() As CreateParams
        Get
            Dim cp As CreateParams = MyBase.CreateParams
            cp.ExStyle = cp.ExStyle Or &H20
            Return cp
        End Get
    End Property

    Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
    End Sub

    Protected Sub InvalidateEx()
        If (Parent Is Nothing) Then
            Exit Sub
        Else
            Dim rc As New Rectangle(Location, Size)
            Parent.Invalidate(rc, True)
        End If
    End Sub


    Protected Overrides Sub OnMove(ByVal e As EventArgs)
        Me.InvalidateEx()
    End Sub

    Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
        Dim bm As New Bitmap(CInt(Me.ClientSize.Width / 5), CInt(Me.ClientSize.Height / 5))
        Dim pth As New GraphicsPath()
        pth.AddString(Me.Text, New FontFamily("Verdana"), CInt(FontStyle.Regular), 100, New Point(20, 20), StringFormat.GenericTypographic)
        Dim h As Graphics = Graphics.FromImage(bm)
        Dim mx As New Matrix(1.0F / 5, 0, 0, 1.0F / 5, -(1.0F / 5), -(1.0F / 5))
        h.SmoothingMode = SmoothingMode.AntiAlias
        h.Transform = mx
        Dim p As New Pen(Color.Yellow, 3)
        h.DrawPath(p, pth)
        h.FillPath(Brushes.Yellow, pth)
        h.Dispose()
        e.Graphics.Transform = New Matrix(1, 0, 0, 1, 50, 50)
        e.Graphics.SmoothingMode = SmoothingMode.AntiAlias
        e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic
        e.Graphics.DrawImage(bm, ClientRectangle, 0, 0, bm.Width, bm.Height, GraphicsUnit.Pixel)
        e.Graphics.FillPath(Brushes.Black, pth)
        pth.Dispose()
    End Sub

    Public Sub pInvalidate()
        Me.InvalidateEx()
    End Sub

End Class


~ Soumya92

QuestionHow to open an excel file in the Visual Basic 6.0 Form Pin
Member 224184315-May-08 1:02
Member 224184315-May-08 1:02 
AnswerRe: How to open an excel file in the Visual Basic 6.0 Form Pin
helelark12315-May-08 3:30
helelark12315-May-08 3:30 
QuestionInsert Row In Excel File Pin
hitesh sojitra15-May-08 0:36
hitesh sojitra15-May-08 0:36 
AnswerRe: Insert Row In Excel File Pin
parth.p15-May-08 0:59
parth.p15-May-08 0:59 
GeneralRe: Insert Row In Excel File Pin
hitesh sojitra15-May-08 1:29
hitesh sojitra15-May-08 1:29 
GeneralRe: Insert Row In Excel File Pin
hitesh sojitra15-May-08 1:48
hitesh sojitra15-May-08 1:48 
GeneralRe: Insert Row In Excel File Pin
hitesh sojitra15-May-08 1:55
hitesh sojitra15-May-08 1:55 
Questiondata binding update problem Pin
asha_s15-May-08 0:33
asha_s15-May-08 0:33 
AnswerRe: data binding update problem Pin
Mycroft Holmes15-May-08 19:44
professionalMycroft Holmes15-May-08 19:44 
QuestionCatching an exception from a control Pin
Steven J Jowett14-May-08 22:33
Steven J Jowett14-May-08 22:33 
AnswerRe: Catching an exception from a control Pin
Chinners15-May-08 0:55
Chinners15-May-08 0:55 
GeneralRe: Catching an exception from a control Pin
Steven J Jowett15-May-08 1:08
Steven J Jowett15-May-08 1:08 
QuestionCompressing in vb .net 2003 Pin
aphei14-May-08 22:23
aphei14-May-08 22:23 
AnswerRe: Compressing in vb .net 2003 Pin
Steven J Jowett14-May-08 22:50
Steven J Jowett14-May-08 22:50 
AnswerRe: Compressing in vb .net 2003 Pin
Steven J Jowett14-May-08 23:07
Steven J Jowett14-May-08 23:07 
QuestionVB 6 question, Pin
nitin314-May-08 20:57
nitin314-May-08 20:57 
AnswerRe: VB 6 question, Pin
helelark12315-May-08 3:34
helelark12315-May-08 3:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.