本文整理匯總了VB.NET中System.Drawing.Imaging.ImageAttributes.SetOutputChannel方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET ImageAttributes.SetOutputChannel方法的具體用法?VB.NET ImageAttributes.SetOutputChannel怎麽用?VB.NET ImageAttributes.SetOutputChannel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Drawing.Imaging.ImageAttributes
的用法示例。
在下文中一共展示了ImageAttributes.SetOutputChannel方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: ShowOutputChannels
Private Sub ShowOutputChannels(ByVal e As PaintEventArgs)
'Create a bitmap from a file.
Dim bmp1 As New Bitmap("c:\fakePhoto.jpg")
' Create a new bitmap from the original, resizing it for this example.
Dim bmp2 As New Bitmap(bmp1, New Size(80, 80))
bmp1.Dispose()
' Create an ImageAttributes object.
Dim imgAttributes As New System.Drawing.Imaging.ImageAttributes()
' Draw the image unaltered.
e.Graphics.DrawImage(bmp2, 10, 10)
' Draw the image, showing the intensity of the cyan channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelC, ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(100, 10, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
' Draw the image, showing the intensity of the magenta channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelM, ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(10, 100, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
' Draw the image, showing the intensity of the yellow channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelY, _
ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(100, 100, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
' Draw the image, showing the intensity of the black channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelK, _
ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(10, 190, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
'Dispose of the bitmap.
bmp2.Dispose()
End Sub