打印本文 打印本文 关闭窗口 关闭窗口
走近VB.Net(三) 源码详解—运用颜色的初步探讨
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3997  更新时间:2009/4/23 19:01:11  文章录入:mintao  责任编辑:mintao
nbsp;     Lab4.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Lab4.Font = New System.Drawing.Font("宋体", 12!, System.Drawing.FontStyle.Bold)
        Lab4.TabIndex = 9
        
        PictureBox1.Cursor = System.Drawing.Cursors.Hand
        PictureBox1.BackgroundImage = CType(resources.GetObject("PictureBox1.BackgroundImage"), System.Drawing.Image)
        PictureBox1.Location = New System.Drawing.Point(8, 8)
        PictureBox1.Size = New System.Drawing.Size(176, 168)
        PictureBox1.TabIndex = 0
        PictureBox1.TabStop = False
        
        Button1.Location = New System.Drawing.Point(304, 48)
        Button1.ForeColor = System.Drawing.SystemColors.ControlLightLight
        Button1.Size = New System.Drawing.Size(24, 120)
        Button1.TabIndex = 2
        Button1.Text = "退出"
        Me.Text = "Form1"
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.BorderStyle = System.WinForms.FormBorderStyle.None
        Me.BackColor = System.Drawing.Color.Black
        Me.ClientSize = New System.Drawing.Size(344, 256)
        Me.Opacity = 0.8#
        
        Me.Controls.Add(Label2)
        Me.Controls.Add(Lab4)
        Me.Controls.Add(Lab3)
        Me.Controls.Add(Lab2)
        Me.Controls.Add(LBblue)
        Me.Controls.Add(LBgreen)
        Me.Controls.Add(LBred)
        Me.Controls.Add(Button1)
        Me.Controls.Add(Label1)
        Me.Controls.Add(PictureBox1)
    End Sub
    
#End Region
    上面一段#Region " Windows Form Designer generated code "是不必看的,
我全部写在这里是为了您可以直接粘贴运行
 
    Sub me_load()
        system.WinForms.MessageBox.show("欢迎使用我的第一个VB.Net程序", "微型取色器", messagebox.OK BitOr messagebox.IconAsterisk)
    End Sub
    
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) ''''sender是发送数据的对象,e是按收参数的对象
        End ''''退出程序
    End Sub
    
    Protected Sub PictureBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) ''''sender是发送数据的对象,e是按收参数的对象
        If apr = True Then system.WinForms.MessageBox.show("请将鼠标重新移入再次取色", "微型取色器", messagebox.OK BitOr messagebox.IconAsterisk)
        apr = True ''''选定色彩以后,RGB的分析就停止
        label2.BackColor = label1.BackColor ''''把源色彩传到目的色彩
    End Sub
    
    Public Function Getpixel() As System.Drawing.Color ''''这个也是函数的一个Alias
        Dim PM As System.Drawing.Bitmap ''''声明一个对象
        PM = PictureBox1.BackgroundImage ''''设置一个实例(注意前面的Option Strict Off不能少)
        Return pm.GetPixel(pixX, pixY) ''''使用Return返回一个值给函数,这是调用system.drawing.bitmap类的getpixel函数
        ''''如果是一个成员过程,不是一个函数,请用调用过程的方法调用,如system.drawing.bitmap类的setpixel过程:
        ''''Public Sub Setpixel(ByVal X As Integer, ByVal Y As Integer, ByVal pColor As System.Drawing.Color)
        ''''Dim PM As System.Drawing.Bitmap

上一页  [1] [2] [3] [4] [5]  下一页

打印本文 打印本文 关闭窗口 关闭窗口