Hi!
How can I "crop" out an elliptical portion of a bitmap? The code I posted here only draws the bitmap and the circle. I want to make something that will copy only what is within the circle. (Do I need to use the circle formula for this?)
Thanks. ~NinjaNic

vb Code:
  1. Public Class Form1
  2.  
  3.     Dim BitmapLocation As New Point(0, 0)
  4.     Dim B As New Bitmap(My.Resources.picture)
  5.  
  6.     Private Sub Form1_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
  7.         e.Graphics.DrawImage(B, New Point(0, 0))
  8.         e.Graphics.DrawEllipse(Pens.Black, CreateRectangle)
  9.         'I need the part of the bitmap inside the circle.
  10.     End Sub
  11.  
  12.     Private Function CreateRectangle() As Rectangle
  13.         Dim R As New Rectangle
  14.         R.Location = BitmapLocation
  15.         If B.Width > B.Height Then
  16.             R.Width = B.Height
  17.             R.Height = B.Height
  18.             R.X += CInt((B.Width - B.Height) / 2)
  19.         Else
  20.             R.Width = B.Width
  21.             R.Height = B.Width
  22.             R.Y += CInt((B.Height - B.Width) / 2)
  23.         End If
  24.         Return R
  25.     End Function
  26.  
  27. End Class