I try To Fill RectangleShape with image but when I try to fill İmage than it is not fit into the Drawed Shape. Not Stretched Mode.
What I have tried:
Public Sub FillRectangle(ByVal g As Graphics, ByVal brush As Brush, ByVal x As Decimal, ByVal y As Decimal, ByVal width As Decimal, ByVal height As Decimal, ByVal radius As Decimal)
Dim area As Rectangle = New Rectangle(x, y, width, height)
Dim path As New Drawing2D.GraphicsPath
path.AddArc(area.Left, area.Top, radius * 2, radius * 2, 180, 90)
path.AddArc(area.Right - (radius * 2), area.Top, radius * 2, radius * 2, 270, 90)
path.AddArc(area.Right - (radius * 2), area.Bottom - (radius * 2), radius * 2, radius * 2, 0, 90)
path.AddArc(area.Left, area.Bottom - (radius * 2), radius * 2, radius * 2, 90, 90)
g.FillPath(brush, path)
End Sub
Private Sub PrintDocument2_PrintPage(sender As Object, e As PrintPageEventArgs) Handles PrintDocument2.PrintPage
e.Graphics.PageUnit = GraphicsUnit.Millimeter
e.Graphics.ResetTransform()
PrintDocument2.OriginAtMargins = True
Dim grpX As Graphics = e.Graphics
Dim newImage As Image = Drawing.Image.FromFile("C:\Users\Yaman\Desktop\Frames\243.png")
Dim brsh As New TextureBrush(newImage)
FillRectangle(grpX, brsh, CDec(4.65), CDec(12.9), CDec(99.1), CDec(33.9), 5)
End Sub