■44289 / inTopicNo.2) |
Re[1]: PictureBox に画像が新たに読み込まれた時のイベント |
□投稿者/ 魔界の仮面弁士 (1404回)-(2009/12/04(Fri) 10:48:13)
|
■No44288 (とりの さん) に返信
> PictureBoxに画像が新たに読み込まれた時のイベントが知りたいのですが、何か良いイベントは有るでしょうか。
こういう事で良いのかな…?
Imports System.ComponentModel
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
Me.AutoScroll = True
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
PictureBox1.LoadAsync("http://agora.ex.nii.ac.jp/digital-typhoon/latest/globe/2048x2048/vis.jpg")
End Sub
Private Sub PictureBox1_LoadCompleted(ByVal sender As Object, ByVal e As AsyncCompletedEventArgs) Handles PictureBox1.LoadCompleted
Dim sz As Size = PictureBox1.Image.Size
MsgBox(sz.ToString(), MsgBoxStyle.Information)
PictureBox1.Size = sz
End Sub
Private Sub PictureBox1_LoadProgressChanged(ByVal sender As Object, ByVal e As ProgressChangedEventArgs) Handles PictureBox1.LoadProgressChanged
Dim progress As String = CStr(e.ProgressPercentage) & "%"
Debug.WriteLine(progress)
Me.Text = progress
End Sub
End Class
|
|