Advertisement
calfred2808

Conner Circle Image PictureBox

Sep 6th, 2018
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.31 KB | None | 0 0
  1. 'https://laptrinhvb.net/bai-viet/chuyen-de-csharp/---Csharp----Huong-dan-tao-conner-circle-image-trong-PictureBox/22b5b2caa895c8c8.html
  2.  
  3. Imports System
  4. Imports System.Collections.Generic
  5. Imports System.ComponentModel
  6. Imports System.Data
  7. Imports System.Drawing
  8. Imports System.Linq
  9. Imports System.Text
  10. Imports System.Threading.Tasks
  11. Imports System.Windows.Forms
  12.  
  13. Namespace Conner_PictureBox
  14.     Public Partial Class Form1
  15.         Inherits Form
  16.  
  17.         Public Sub New()
  18.             InitializeComponent()
  19.         End Sub
  20.  
  21.         Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
  22.             pictureBox1.LoadAsync("http://i569.photobucket.com/albums/ss134/hongchautkn/PHUONGTHAO.jpg")
  23.             Dim r As Rectangle = New Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height)
  24.             Dim gp As System.Drawing.Drawing2D.GraphicsPath = New System.Drawing.Drawing2D.GraphicsPath()
  25.             gp.AddEllipse(0, 0, pictureBox1.Width - 3, pictureBox1.Height - 3)
  26.             Dim rg As Region = New Region(gp)
  27.             pictureBox1.Region = rg
  28.         End Sub
  29.  
  30.         Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
  31.             pictureBox2.LoadAsync("http://i569.photobucket.com/albums/ss134/hongchautkn/PHUONGTHAO.jpg")
  32.         End Sub
  33.     End Class
  34. End Namespace
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement