- Код: Выделить всё
Option Explicit On
Imports System.IO
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Reflection
Imports System.Runtime.InteropServices
Public Class Form1
Private backgroundImage As Bitmap
Private backgroundImageRect As Rectangle
Dim ArrayImage(12) As Image
Dim i As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
backgroundImageRect = New Rectangle(0, 0, backgroundImage.Width, backgroundImage.Height)
ArrayImage(0) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1),
"Frame_00.jpg"))
ArrayImage(1) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_01.jpg"))
ArrayImage(2) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_02.jpg"))
ArrayImage(3) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_03.jpg"))
ArrayImage(4) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_04.jpg"))
ArrayImage(5) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_05.jpg"))
ArrayImage(6) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_06.jpg"))
ArrayImage(7) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_07.jpg"))
ArrayImage(8) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_08.jpg"))
ArrayImage(9) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_09.jpg"))
ArrayImage(10) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_10.jpg"))
ArrayImage(11) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_11.jpg"))
ArrayImage(12) = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_12.jpg"))
backgroundImage = New Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(SmartDeviceProject4.Form1), "Frame_00.jpg"))
Timer1.Interval = 10
Timer1.Enabled = True
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
End Sub
Protected Overrides Sub OnPaintBackground(ByVal e As System.Windows.Forms.PaintEventArgs)
e.Graphics.DrawImage(backgroundImage, MyBase.ClientRectangle, backgroundImageRect, GraphicsUnit.Pixel)
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If i = 13 Then
Timer1.Enabled = False
Else
backgroundImage = ArrayImage(i)
Me.Refresh()
End If
i = i + 1
End Sub
End Class
Метод не самый быстрый , качество изображения соответствующее.
Кто занимался подобной тематикой, подскажите как ускорить вывод полноформатных изображений?