NSDWebPicture メンバ
Web画面を画像ファイルに変換します。
●コンストラクタ
名前 説明 NSDWebPicture NSDWebPictureを初期化します。
●プロパティの一覧
名前 説明 BlankCut 余白の削除を設定します。 BlankMarginBottom 余白を削除する場合に使用する下マージンの高さを設定します。 BlankMarginLeft 余白を削除する場合に使用する左マージン幅を設定します。 JpegQuality JPEGで保存する時の品質を設定します。 MinimumHeight Webページの最小の高さを設定します。 MinimumWidth Webページの最小の幅を設定します。 SelectSize 指定サイズでの取得を設定します。 SelectSizeBlankColor 指定サイズの余白色を設定します。 SelectSizeHeight 指定サイズの高さを設定します。 SelectSizeSetBlankColor 指定サイズの余白の色を設定するかを設定します。 SelectSizeStyle 指定サイズの取得スタイルを設定します。 SelectSizeWidth 指定サイズの幅を設定します。 StringSize 文字のサイズを設定します。 Thumbnail サムネイルでの作成有無を設定します。 ThumbnailHeight サムネイルの高さを設定します。 ThumbnailWidth サムネイルの幅を設定します。 Zoom 倍率を設定します。
●メソッドの一覧
名前 引数 戻り値 説明 Dispose なし なし リソースの解放を行います。 SaveImage ( String , String , NSDPictureExtension) Boolean型 Web画面のイメージをファイルに保存します。
●定数の一覧
名前:NSDPictureExtension (画像ファイルの拡張子)
名前
内容
Jpeg
ジェイペグ(Joint Photographic Experts Group)。
Bmp
ビットマップ(Bitmap)。
Gif
グラフィック・インターチェンジ・フォーマット(Graphics Interchange Format)。
Png
ポータブル・ネットワーク・グラフィックス(Portable Network Graphics)。
Tiff
ティフ(Tagged Image File Format)。
名前:NSD_SELECT_GET_SIZE_STYLE (指定サイズの取得スタイル)
名前
内容
Auto 自動調整。 Blank Webページの短辺に余白が有ります。 ShortVininity Webページの短辺に合わせます(余白なし)。 LongVininity Webページの長辺に合わせます(余白なし)。 ShortVininityBlank Webページの短辺に合わせます(余白あり)。 LongVininityBlank Webページの長辺に合わせます(余白あり)。 Width 幅(指定サイズ)を合わせます(余白なし)。 Height 高さ(指定サイズ)を合わせます(余白なし)。 WidthBlank 幅(指定サイズ)を合わせます(余白あり)。 HeightBlank 高さ(指定サイズ)を合わせます(余白あり)。
名前:NSD_WEB_STRING_SIZE (ブラウザの文字サイズ)
名前
内容
Smallest 最小。 Small 小。 Medium 中。 Large 大。 Largest 最大。
●NSDWebPictureコンストラクタの説明
構文:Public Sub New(ByRef ClsRef_Form As Form)
使用法:Dim Cls_NWP As New NSDWebPicture(Me)
引数:なし。
使用例:
Public Class Form1 Dim Cls_NWP As New NSDWebPicture(Me) : End Class
●NSDWebPictureプロパティの説明
名前:BlankCut
構文:Public Property BlankCut() As Boolean 機能:余白の削除を設定します。
※余白部分は取得画像から割り出すので、Webページのサイズによっては時間がかかります。
Set値:True : 画像の下部、左部分に背景色と同じ色の領域(1ドット単位で行、列にて確認)の場合、指定マージンを超える場合は削除します。
False: 余白の削除を行いません。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 余白を自動削除する. Cls_NWP.BlankCut = True ' 余白の左マージン. Cls_NWP.BlankMarginLeft = 15 ' 余白の下マージン. Cls_NWP.BlankMarginBottom = 15 ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:BlankMarginBottom
構文:Public Property BlankMarginBottom() As Integer 機能:余白を削除する場合に使用する下マージンの高さを設定します。
Set値:画像の下部に背景色と同じ色の領域(1ドット単位で行、列にて確認)の場合、下マージンを超える場合は削除します。
※余白が下マージンの高さ以下の場合は、余白は追加されません。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 余白を自動削除する. Cls_NWP.BlankCut = True ' 余白の左マージン. Cls_NWP.BlankMarginLeft = 15 ' 余白の下マージン. Cls_NWP.BlankMarginBottom = 15 ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:BlankMarginLeft
構文:Public Property BlankMarginLeft() As Integer 機能:余白を削除する場合に使用する左マージン幅を設定します。
Set値:画像の左部分に背景色と同じ色の領域(1ドット単位で行、列にて確認)の場合、左マージンを超える場合は削除します。
※余白が左マージン幅以下の場合は、余白は追加されません。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 余白を自動削除する. Cls_NWP.BlankCut = True ' 余白の左マージン. Cls_NWP.BlankMarginLeft = 15 ' 余白の下マージン. Cls_NWP.BlankMarginBottom = 15 ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:JpegQuality
構文:Public Property JpegQuality() As Integer 機能:JPEGで保存する時の品質を設定します。
Set値:JPEGで保存する時の品質(0〜100)を設定します。
※100が最も高品質の画像です。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' JPEGで保存する時の品質を設定します. Cls_NWP.JpegQuality = 60 ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Jpeg) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:MinimumHeight
構文:Public Property MinimumHeight() As Integer 機能:Webページの最小の高さを設定します。
Set値:Webページの最小の高さを設定します。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 最小の幅を設定. Cls_NWP.MinimumWidth = 640 ' 最小の高さを設定. Cls_NWP.MinimumHeight = 480 ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:MinimumWidth
構文:Public Property MinimumWidth() As Integer 機能:Webページの最小の幅を設定します。
Set値:Webページの最小の幅を設定します。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 最小の幅を設定. Cls_NWP.MinimumWidth = 640 ' 最小の高さを設定. Cls_NWP.MinimumHeight = 480 ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:SelectSize
構文:Public Property SelectSize() As Boolean 機能:指定サイズでの取得を設定します。
Set値:True : 指定サイズで作成します。
※Thumbnailと同時に指定できません。
False: 指定サイズで作成しません。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 指定サイズでの取得. Cls_NWP.SelectSize = True ' 幅. Cls_NWP.SelectSizeWidth = 640 ' 高さ. Cls_NWP.SelectSizeHeight = 480 ' スタイル. Cls_NWP.SelectSizeStyle = NSDWebPicture.NSD_SELECT_GET_SIZE_STYLE.ShortVininity ' 余白の色を指定する. Cls_NWP.SelectSizeSetBlankColor = True ' 余白の色. Cls_NWP.SelectSizeBlankColor = Color.White ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:SelectSizeBlankColor
構文:Public Property SelectSizeBlankColor() As System.Drawing.Color 機能:指定サイズの余白色を設定します。
Set値:System.Drawing.Color。
※SelectSizeSetBlankColorがTrueのときに有効になります。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 指定サイズでの取得. Cls_NWP.SelectSize = True ' 幅. Cls_NWP.SelectSizeWidth = 640 ' 高さ. Cls_NWP.SelectSizeHeight = 480 ' スタイル. Cls_NWP.SelectSizeStyle = NSDWebPicture.NSD_SELECT_GET_SIZE_STYLE.ShortVininity ' 余白の色を指定する. Cls_NWP.SelectSizeSetBlankColor = True ' 余白の色. Cls_NWP.SelectSizeBlankColor = Color.White ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:SelectSizeHeight
構文:Public Property SelectSizeHeight() As Integer 機能:指定サイズの高さを設定します。
Set値:指定サイズの高さを設定します。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 指定サイズでの取得. Cls_NWP.SelectSize = True ' 幅. Cls_NWP.SelectSizeWidth = 640 ' 高さ. Cls_NWP.SelectSizeHeight = 480 ' スタイル. Cls_NWP.SelectSizeStyle = NSDWebPicture.NSD_SELECT_GET_SIZE_STYLE.ShortVininity ' 余白の色を指定する. Cls_NWP.SelectSizeSetBlankColor = True ' 余白の色. Cls_NWP.SelectSizeBlankColor = Color.White ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:SelectSizeSetBlankColor
構文:Public Property SelectSizeSetBlankColor() As Boolean 機能:指定サイズの余白の色を設定するかを設定します。
Set値:True : 余白の色はSelectSizeBlankColorで設定された色になります。
False: 余白の色はWebページの背景色になります。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 指定サイズでの取得. Cls_NWP.SelectSize = True ' 幅. Cls_NWP.SelectSizeWidth = 640 ' 高さ. Cls_NWP.SelectSizeHeight = 480 ' スタイル. Cls_NWP.SelectSizeStyle = NSDWebPicture.NSD_SELECT_GET_SIZE_STYLE.ShortVininity ' 余白の色を指定する. Cls_NWP.SelectSizeSetBlankColor = True ' 余白の色. Cls_NWP.SelectSizeBlankColor = Color.White ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:SelectSizeStyle
構文:Public Property SelectSizeStyle() As NSD_SELECT_GET_SIZE_STYLE 機能:指定サイズの取得スタイルを設定します。
Set値:指定サイズの取得スタイルを設定します。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 指定サイズでの取得. Cls_NWP.SelectSize = True ' 幅. Cls_NWP.SelectSizeWidth = 640 ' 高さ. Cls_NWP.SelectSizeHeight = 480 ' スタイル. Cls_NWP.SelectSizeStyle = NSDWebPicture.NSD_SELECT_GET_SIZE_STYLE.ShortVininity ' 余白の色を指定する. Cls_NWP.SelectSizeSetBlankColor = True ' 余白の色. Cls_NWP.SelectSizeBlankColor = Color.White ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:SelectSizeWidth
構文:Public Property SelectSizeWidth() As Integer 機能:指定サイズの幅を設定します。
Set値:指定サイズの幅を設定します。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 指定サイズでの取得. Cls_NWP.SelectSize = True ' 幅. Cls_NWP.SelectSizeWidth = 640 ' 高さ. Cls_NWP.SelectSizeHeight = 480 ' スタイル. Cls_NWP.SelectSizeStyle = NSDWebPicture.NSD_SELECT_GET_SIZE_STYLE.ShortVininity ' 余白の色を指定する. Cls_NWP.SelectSizeSetBlankColor = True ' 余白の色. Cls_NWP.SelectSizeBlankColor = Color.White ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:StringSize
構文:Public Property StringSize() As NSD_WEB_STRING_SIZE 機能:文字のサイズを設定します。
Set値:ブラウザ表示の文字サイズを設定します。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 文字のサイズを設定. Cls_NWP.StringSize = NSD_WEB_STRING_SIZE.Medium ' 中. ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:Thumbnail
構文:Public Property Thumbnail() As Boolean 機能:サムネイルでの作成有無を設定します。
Set値:True : サムネイルで作成します。
※SelectSizeと同時に指定できません。
False: サムネイルで作成しません。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' サムネイルで作成します. Cls_NWP.Thumbnail = True ' サムネイルサイズ(幅)を設定します. Cls_NWP.ThumbnailWidth = 120 ' サムネイルサイズ(高さ)を設定します. Cls_NWP.ThumbnailHeight = 120 ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:ThumbnailHeight
構文:Public Property ThumbnailHeight() As Integer 機能:サムネイルの高さを設定します。
Set値:サムネイルの高さを指定します。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' サムネイルで作成します. Cls_NWP.Thumbnail = True ' サムネイルサイズ(幅)を設定します. Cls_NWP.ThumbnailWidth = 120 ' サムネイルサイズ(高さ)を設定します. Cls_NWP.ThumbnailHeight = 120 ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:ThumbnailWidth
構文:Public Property ThumbnailWidth() As Integer 機能:サムネイルの幅を設定します。
Set値:サムネイルの幅を指定します。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' サムネイルで作成します. Cls_NWP.Thumbnail = True ' サムネイルサイズ(幅)を設定します. Cls_NWP.ThumbnailWidth = 120 ' サムネイルサイズ(高さ)を設定します. Cls_NWP.ThumbnailHeight = 120 ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
名前:Zoom
構文:Public Property Zoom() As Integer 機能:倍率を設定します。
※規定のブラウザがInternet Explorer 7以上が必須です。
Set値:ブラウザ表示の倍率を設定します。
※10〜1000までが指定可能です。
Get値:Set値を参照。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' 倍率を設定. Cls_NWP.Zoom = 200 ' 倍率200%を指定. ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
●NSDWebPictureメソッド の説明
名前:Dispose
構文:Public Overridable Sub Dispose() Implements IDisposable.Dispose 機能:リソースの解放を行います。
※終了時に必ず呼び出します。
引数:なし。
戻り値:なし。
使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub End Class
名前:SaveImage
構文:Public Function SaveImage( Url , FileName , Extension ) As Boolean
機能:Web画面のイメージをファイルに保存します。
引数:
名前 型 引数渡しの方法 説明 Url String 値渡し(ByVal) URLを渡します。
※例:http://www.nsgd.co.jp/nsd/FileName String 値渡し(ByVal) 画像ファイルを保存するファイルのフルパス名を渡します。
※拡張子は指定しなくてもかまいません。Extension NSDPictureExtension 値渡し(ByVal) 保存するファイルの画像形式を渡します。 戻り値:Boolean
戻り値の説明:
True :成功
False:失敗、エラー発生使用例:
Public Class Form1 ' NSDWebPictureを初期化します. Dim Cls_NWP As New NSDWebPicture(Me) ' FormClosing. Private Sub Form1_FormClosing( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing Try ' NSDWebPictureのリソースを解放します. If Not (Cls_NWP Is Nothing) Then Cls_NWP.Dispose() Cls_NWP = Nothing End If Catch ex As Exception End Try End Sub ' 画像ファイルに変換. Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Try Do Dim Str_Url As String = Me.TextBox1.Text ' URL. If String.IsNullOrEmpty(Str_Url) Then MsgBox("URLを入力してください。") Exit Do End If Dim Str_File As String = Me.TextBox2.Text ' ファイル名. If String.IsNullOrEmpty(Str_File) Then MsgBox("保存するファイルをフルパス名で入力してください。") Exit Do End If ' ファイルを作成. If Cls_NWP.SaveImage(Str_Url, Str_File, _ NSDWebPicture.NSDPictureExtension.Bmp) Then MsgBox("ファイルを作成しました。") Else MsgBox("ファイルの作成に失敗しました。") End If Loop While (0) Catch ex As Exception End Try End Sub End Class
Copyright (C) 2010 Nihon System Developer Corp. All Rights Reserved.