DrawImage quality strange...

Results 1 to 2 of 2

Thread: DrawImage quality strange...

  1. #1
    Join Date
    Dec 1969

    Default DrawImage quality strange...

    Hi there,<BR>I am new to ASP.NET and I am trying play arround with the autmoatic created images. I pick up a jpeg and want to replace one color with another and have till so far come up:<BR><BR> Dim objImage = New Bitmap(MyFileName)<BR> Dim objGraphics = Graphics.FromImage(objImage)<BR><BR> Dim MyColorMap(0) As ColorMap<BR> MyColorMap(0) = New ColorMap()<BR> MyColorMap(0).OldColor = Color.FromName(MyOldColor)<BR> MyColorMap(0).NewColor = Color.FromName(MyNewColor)<BR><BR> Dim MyAttribute As New ImageAttributes()<BR> MyAttribute.SetRemapTable(MyColorMap)<BR><BR> Dim imgRectangle As New Rectangle(0, 0, objImage.Width, objImage.Height)<BR> objGraphics.DrawImage(objImage, imgRectangle, 0, 0, objImage.Width, objImage.Height, GraphicsUnit.Pixel, MyAttribute)<BR><BR> Response.ContentType = "image/jpeg"<BR> objImage.Save(Response.OutputStream, ImageFormat.Jpeg)<BR><BR> objGraphics.dispose()<BR> objImage.dispose()<BR><BR>It works "okay" except that the border of the replaced area is of a very strange quality. It is very blocky on the outside... The fill color is okay and solid but the edges are like big blocks and some pixels mixed in the margin... huh?<BR><BR>Anybody any ideas? Would be very appreciated!<BR>ronald_colijn@hotmail.com

  2. #2
    Join Date
    Dec 1969

    Default RE: DrawImage quality strange...

    You could try setting some quality parameters. Here is one example and there are many more in this forum. Use the advanced search feature to find them. Link:<BR>http://www.aspmessageboard.com/forum/showMessage.asp?F=36&M=625120&P=1#625120

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts