FarPoint.Win アセンブリ > FarPoint.Win 名前空間 > Picture クラス : TransparencyTolerance プロパティ |
'Declaration
Public Overridable Property TransparencyTolerance As Integer
public virtual int TransparencyTolerance {get; set;}
許容誤差の値は0〜255です。
透過許容誤差は、レンダリングされた画像を透過させる場合に、赤、緑、青の各成分がTransparencyColorにどれだけ近い色を透過色とみなすかを決定します。たとえば、TransparencyColorがColor.White(255,255,255)で、TransparencyToleranceが1の場合は、(254,254,254)の色も透過色とみなされます。private void DrawPicture(System.Windows.Forms.PaintEventArgs e) { Graphics g = e.Graphics; FarPoint.Win.Picture p = new FarPoint.Win.Picture(Image.FromFile("d:\\earth.ico"), RenderStyle.Normal, Color.White, 50, HorizontalAlignment.Center, VerticalAlignment.Center); g.DrawImage(p.Image, 20, 20); int i = p.TransparencyTolerance; MessageBox.Show("The tolerance is " + i.ToString()); }
Private Sub DrawPicture(ByVal e As PaintEventArgs) Dim g As Graphics = e.Graphics Dim p As New FarPoint.Win.Picture(Image.FromFile("d:\earth.ico"), RenderStyle.Normal, Color.White, 50, HorizontalAlignment.Center,VerticalAlignment.Center) g.DrawImage(p.Image, 20, 20) Dim i As Integer = p.TransparencyTolerance MessageBox.Show("The tolerance is " + i.ToString()) End Sub