btazap.blogg.se

Windows 10 gif loading
Windows 10 gif loading










Patience.Location = Point.Add(parent.PointToScreen(Me.Location), New Size(0, + GIFs on Twitter is not smooth sailing, because of the restrictions on GIF uploading on Twitter. Here's how the loading overlay is being called and closed: Private Sub ShowLoadingOverlay() ImageAnimator.StopAnimate(animatedImage, AddressOf Me.OnFrameChanged) TextRenderer.DrawText(e.Graphics, strStatus, Me.Font, GetTextLocation(Me.animatedImage.Size), Color.White, Color.Black)įinally, the ImageAnimator.StopAnimate method is called in the Form Closing event: Private Sub LoadingOverlay_FormClosed(ByVal sender As Object, ByVal e As ) Handles Me.FormClosed Then onPaint is overridden and does the drawing: Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)Į.Graphics.DrawImage(Me.animatedImage, GetCenter(Me.animatedImage.Size)) The onFrameChanged Event Handler just Invalidates the form: Private Sub OnFrameChanged(ByVal sender As Object, ByVal e As System.EventArgs) ImageAnimator.Animate(animatedImage, AddressOf Me.OnFrameChanged)

windows 10 gif loading

Then, in the Form.Shown event the ImageAnimator.Animate method is called: Private Sub LoadingOverlay_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown SetStyle(ControlStyles.UserPaint Or ControlStyles.Opaque, True)

windows 10 gif loading

The onPaint is getting fired and the image frame is being updated, but it isn't visibleĬonstructor sets the form to be UserPainted: Sub New() The loading overlay will appear, show the first frame loading GIF, then just freeze. This upload collects some data from the form, puts it into an Object, then operates entirely on a background thread. The loading overlay works fine on multiple different form loads, but fails to work properly when summoned to ensure patience during a 30 second upload process (That Prints a Word Document to PDF, then uploads that PDF to a SQL Server).

windows 10 gif loading

The overlay is a windows form that I'm drawing in the onPaint event. I'm trying to use a loading overlay on top of a Windows form that adds a 50% opaque layer on top of a windows form with a loading GIF, while it does what it needs to do in a background thread.












Windows 10 gif loading