Dim ImgBg As Bitmap = System.Drawing.Bitmap.FromFile(Filename1)ImgBg.SetResolution(72, 72) Dim g As Graphics = Graphics.FromImage(ImgBg)g.SmoothingMode = Drawing2D.SmoothingMode.NoneDim mybrush As Brush = Brushes.Beigeg.FillRectangle(mybrush, rect)g.Dispose()ImgBg.Save(Filename2)