Does anyone know of any resources with some information on some slightly more advanced graphics examples than those found in the articles section on this site? It seems like every example I can find out there uses a solid, predefined color (like "Green" or something), fills an area, then uses another predefined color like "Black" to write on it. Great...but what about people like me that are trying to use this in the real world where most of the colors in web site designs aren't part of the predefined color list? Or if we need to build complicated graphics? I'm looking for something that will take me a little more in depth. Help!I just finished do this. You wanted slightly more advanced.... this is long.....<BR>---------------------------------------------------------------<BR>using System;<BR>using System.Data;<BR>using System.Collections;<BR>using System.Web;<BR>using System.Web.UI;<BR>using System.Drawing;<BR>using System.Drawing.Imaging;<BR>using System.Drawing.Drawing2D;<BR>using System.IO;<BR>using System.Web.SessionState;<BR><BR><BR>namespace GUI35_NET.HomePage2<BR>{<BR><BR> public class elityLogo : System.Web.UI.Page<BR> {<BR> public string mstrUserName = null;<BR> private Bitmap objBmp;<BR> private Graphics objGrx;<BR> private SolidBrush brsDarkBlue = new SolidBrush(Color.FromArgb(51, 102, 153));<BR> private SolidBrush brsBlack = new SolidBrush(Color.Black);<BR> private LinearGradientBrush lgbBlackBlue = new LinearGradientBrush(new Rectangle(0, 0, 700, 300), Color.Black, Color.FromArgb(51, 102, 153), LinearGradientMode.Horizontal);<BR> private LinearGradientBrush lgBrush;<BR><BR> private Pen penBlack2px = new Pen(Brushes.Black, 2.0f);<BR> private Pen penLightBlueAlpha50 = new Pen(Color.FromArgb(50, 221, 238, 255), 4.0f);<BR> private Pen penWhite1px = new Pen(Brushes.White, 1.0f);<BR> private Font fntVerdana10Bold = new Font("Verdana", 10, FontStyle.Bold);<BR> private SolidBrush brsWhiteAlpha50 = new SolidBrush(Color.FromArgb(50, 255, 255, 255));<BR> private Font fntArial;<BR><BR><BR> private void Page_Load(object sender, System.EventArgs e)<BR> {<BR> if(!IsPostBack)<BR> {<BR><BR> initImage();<BR> drawLogoBackground();<BR> drawLogo();<BR> drawCoolPlate();<BR> drawWelcomeMessage();<BR> drawLinkContainers();<BR> sendImageToOutput();<BR> }<BR> }<BR><BR> private void initImage()<BR> {<BR> objBmp = new Bitmap(700, 300);<BR> objGrx = Graphics.FromImage(objBmp);<BR> objGrx.CompositingQuality = CompositingQuality.HighQuality;<BR> }<BR><BR> private void drawCoolPlate()<BR> {<BR> //Define array of points that describe the plate image<BR> Point[] pntArrayPlate = {new Point(640, 20),<BR> new Point(680, 60),<BR> new Point(680, 240),<BR> new Point(640, 280),<BR> new Point(300, 280),<BR> new Point(300, 110),<BR> new Point(640, 110),<BR> new Point(640, 20)};<BR> //Define array of bytes that describe the point types<BR> byte[] bytArrayPlate = {(byte) PathPointType.Start,<BR> (byte) PathPointType.Line,<BR> (byte) PathPointType.Line,<BR> (byte) PathPointType.Line,<BR> (byte) PathPointType.Line,<BR> (byte) PathPointType.Line,<BR> (byte) PathPointType.Line,<BR> (byte) PathPointType.Line};<BR> //Define new Path<BR> GraphicsPath grpPlate = new GraphicsPath(pntArrayPlate, bytArrayPlate);<BR> //Fill Path<BR> objGrx.FillPath(brsDarkBlue, grpPlate);<BR> //Outline Path<BR> objGrx.DrawPath(penBlack2px, grpPlate);<BR> //Fill inner rectangle<BR> objGrx.FillRectangle(lgbBlackBlue, 320, 130, 320, 130);<BR> //Outline inner rectangle<BR> objGrx.DrawRectangle(penBlack2px, 320, 130, 320, 130);<BR> //Tag line<BR> objGrx.DrawString("E x p a n d i n g t h e P o w e r o f D a t a", fntVerdana10Bold, brsWhiteAlpha50, new Rectangle(320, 112, 350, 20));<BR> }<BR> private void drawLinkContainers()<BR> {<BR> DirectoryInfo diMaps = new DirectoryInfo(Server.MapPath("maps"));<BR> StreamWriter objSw = new StreamWriter(Server.MapPath("maps/" + Session["mapName"]));<BR> Rectangle recLink;<BR> Rectangle recLight;<BR> fntArial = new Font("Arial", 9, FontStyle.Bold);<BR> SolidBrush brsLight = new SolidBrush(Color.FromArgb(255, 220, 220, 220));<BR> string strMapFile = Request.QueryString["map"];<BR> string strLinkText = null;<BR> int intOuterRecX = 235;<BR> int intOuterRecY = 140;<BR> int intOuterRecWidth = 90;<BR> int intOuterRecHeight = 30;<BR> int intSpacer = 10;<BR> int i = 0;<BR> int j = 0;<BR> int intContainerMarker = 0;<BR> int intMapX1 = 0;<BR> int intMapY1 = 0;<BR> int intMapX2 = 0;<BR> int intMapY2 = 0;<BR><BR><BR> //Clean up old map files first<BR> foreach(FileInfo fiMap in diMaps.GetFiles())<BR> {<BR> //Delete any files that were not created today<BR> if(fiMap.CreationTime.ToShortDateString() != DateTime.Now.ToShortDateString())<BR> fiMap.Delete();<BR> }<BR><BR> recLink = new Rectangle(intOuterRecX, intOuterRecY, intOuterRecWidth, intOuterRecHeight);<BR><BR> //Loop for rows<BR> for(i=0; i<8; i=i+3)<BR> {<BR> //Loop for cols<BR> for(j=0; j<3; j++)<BR> { <BR> //Define outer rectangle<BR> recLink = new Rectangle(recLink.X + intOuterRecWidth + intSpacer, intOuterRecY, intOuterRecWidth, intOuterRecHeight);<BR> //Fill outer rectangle<BR> objGrx.FillRectangle(brsDarkBlue, recLink);<BR> //Outline outer rectangle<BR> objGrx.DrawRectangle(penBlack2px, recLink);<BR> //Define inner rectangle<BR> recLight = new Rectangle(recLink.X+4, recLink.Y+4, recLink.Width-8, recLink.Height-8);<BR> //Draw inner rectangle<BR> lgBrush = new LinearGradientBrush(recLight, Color.FromArgb(153, 153, 153), Color.WhiteSmoke, LinearGradientMode.BackwardDiagonal);<BR> objGrx.FillRectangle(lgBrush, recLight);<BR> //Outline inner rectangle<BR> objGrx.DrawRectangle(penLightBlueAlpha50, recLight);<BR> //Inner rectangle edge highlights<BR> objGrx.DrawLine(penWhite1px, recLight.X, recLight.Y, recLight.Width+recLight.X, recLight.Y);<BR> objGrx.DrawLine(penWhite1px, recLight.X, recLight.Y, recLight.X, recLight.Y+recLight.Height);<BR> objGrx.DrawLine(penBlack2px, recLight.X+recLight.Width, recLight.Y, recLight.X+recLight.Width, recLight.Y+recLight.Height);<BR> objGrx.DrawLine(penBlack2px, recLight.X, recLight.Y+recLight.Height, recLight.X+recLight.Width, recLight.Y+recLight.Height);<BR> <BR> //Link Text and Map entry<BR> switch(intContainerMarker)<BR> {<BR> case -1:<BR> //Set Map Coords<BR> intMapX1 = recLink.X;<BR> intMapY1 = recLink.Y;<BR> intMapX2 = recLink.X + recLink.Width;<BR> intMapY2 = recLink.Y + recLink.Height;<BR> //Write line to Map File<BR> objSw.WriteLine("rect http://localhost/GUI35_NET/HomePage2/targetTest.aspx?clicked=" + strLinkText.Replace(" ", "") + " " +<BR> intMapX1 + "," + intMapY1 + " " + intMapX2 + "," + intMapY2); <BR> //Draw Link String<BR> objGrx.DrawString(strLinkText, fntArial, Brushes.Black, new Rectangle(recLink.X+5, recLink.Y+7, recLink.Width-4, recLink.Height));<BR> break;<BR> case 0:<BR> strLinkText = "Components";<BR> goto case -1;<BR> case 1:<BR> strLinkText = "Connections";<BR> goto case -1;<BR> case 2:<BR> strLinkText = "Data Sources";<BR> goto case -1;<BR> case 3:<BR> strLinkText = "Engine";<BR> goto case -1;<BR> case 4:<BR> strLinkText = "Filters";<BR> goto case -1;<BR> case 5:<BR> strLinkText = "Labels";<BR> goto case -1;<BR> case 6:<BR> strLinkText = "Reports";<BR> goto case -1;<BR> case 7:<BR> strLinkText = "Users";<BR> goto case -1;<BR> case 8:<BR> strLinkText = "Workspaces";<BR> goto case -1;<BR> }<BR> //Next Link<BR> intContainerMarker++;<BR> }<BR> //Reset X Coord<BR> recLink.X = intOuterRecX;<BR> //Move down for next row<BR> intOuterRecY = recLink.Y + intOuterRecHeight + intSpacer;<BR> }<BR> //Cleanup Map File<BR> objSw.Flush();<BR> objSw.Close();<BR> }<BR><BR> private void drawWelcomeMessage()<BR> {<BR> Font fntArial = new Font("Arial", 16, FontStyle.Bold);<BR> Font fntArial2 = new Font("Arial", 28, FontStyle.Bold);<BR> mstrUserName = Request.QueryString["userName"];<BR> <BR><BR> objGrx.FillRectangle(brsDarkBlue, 300, 20, 325, 80);<BR> objGrx.DrawRectangle(penBlack2px, 300, 20, 325, 80);<BR><BR> lgBrush = new LinearGradientBrush(new Rectangle(304, 24, 317, 72), Color.DarkSlateGray, Color.WhiteSmoke, LinearGradientMode.BackwardDiagonal);<BR> objGrx.FillRectangle(lgBrush, 304, 24, 317, 72);<BR> objGrx.DrawRectangle(penBlack2px, 304, 24, 317, 72);<BR><BR> objGrx.FillRectangle(new SolidBrush(Color.FromArgb(50, 255, 255, 255)), 314, 34, 297, 52);<BR> objGrx.DrawLine(new Pen(new SolidBrush(Color.FromArgb(100, 255, 255, 255)), 3), 314, 34, 611, 34);<BR> objGrx.DrawLine(new Pen(new SolidBrush(Color.FromArgb(100, 255, 255, 255)), 3), 314, 34, 314, 86);<BR> objGrx.DrawLine(penBlack2px, 611, 34, 611, 86);<BR> objGrx.DrawLine(penBlack2px, 314, 86, 611, 86);<BR><BR> objGrx.DrawString("Elity InSight", fntArial2, Brushes.Black, 351, 37);<BR> objGrx.DrawString("Elity InSight", fntArial2, Brushes.WhiteSmoke, 349, 35);<BR> objGrx.DrawString("Elity InSight", fntArial2, Brushes.Crimson, 350, 36);<BR> }<BR><BR> private void drawLogo()<BR> {<BR> Int32 i;<BR> Int32 j;<BR> Point[] pntArray = {new Point(165-50, 200-50),<BR> new Point(200-50, 165-50),<BR> new Point(235-50, 200-50),<BR> new Point(200-50, 235-50)};<BR> Point[] pntArrayBlack = {new Point(pntArray[0].X - 4, pntArray[0].Y),<BR> new Point(pntArray[1].X, pntArray[1].Y - 4),<BR> new Point(pntArray[2].X + 4, pntArray[2].Y),<BR> new Point(pntArray[3].X, pntArray[3].Y + 4)};<BR> byte[] bytArray = {(byte)PathPointType.Start,<BR> (byte)PathPointType.Line,<BR> (byte)PathPointType.Line,<BR> (byte)PathPointType.Line};<BR><BR> objGrx.DrawLine(new Pen(new SolidBrush(Color.FromArgb(75, Color.Black)), (float) 10), new Point(pntArray[2].X+4, pntArray[2].Y), new Point(pntArray[3].X, pntArray[3].Y+4));<BR><BR><BR> GraphicsPath pthDiamond = new GraphicsPath(pntArray, bytArray);<BR> objGrx.FillPath(new SolidBrush(Color.Black), new GraphicsPath(pntArrayBlack, bytArray));<BR> <BR> lgBrush = new LinearGradientBrush(new Rectangle(pntArray[0].X, pntArray[0].Y, 70, 70), Color.DarkSlateGray, Color.WhiteSmoke, LinearGradientMode.BackwardDiagonal);<BR> lgBrush.GammaCorrection = true;<BR> objGrx.FillPath(lgBrush, pthDiamond); <BR><BR> Point[] pntArrayLight = {new Point(pntArray[0].X+8, pntArray[0].Y),<BR> new Point(pntArray[1].X, pntArray[1].Y+8),<BR> new Point(pntArray[2].X-8, pntArray[2].Y),<BR> new Point(pntArray[3].X, pntArray[3].Y-8)};<BR> <BR> GraphicsPath grpLight = new GraphicsPath(pntArrayLight, bytArray);<BR> objGrx.FillPath(new SolidBrush(Color.FromArgb(50, 255, 255, 255)), grpLight);<BR><BR> objGrx.DrawLine(new Pen(new SolidBrush(Color.FromArgb(100, 255, 255, 255)), 3), pntArrayLight[0], pntArrayLight[1]);<BR> <BR> for(i=2;i<=9;i++)<BR> {<BR> switch(i)<BR> {<BR> case 0: //Red Diamond<BR> pntArrayBlack[0].X = pntArray[0].X - 4;<BR> pntArrayBlack[0].Y = pntArray[0].Y;<BR> pntArrayBlack[1].X = pntArray[1].X;<BR> pntArrayBlack[1].Y = pntArray[1].Y - 4;<BR> pntArrayBlack[2].X = pntArray[2].X + 4;<BR> pntArrayBlack[2].Y = pntArray[2].Y;<BR> pntArrayBlack[3].X = pntArray[3].X;<BR> pntArrayBlack[3].Y = pntArray[3].Y + 4;<BR> pthDiamond = new GraphicsPath(pntArray, bytArray);<BR><BR><BR> pntArrayLight[0].X = pntArray[0].X+8;<BR> pntArrayLight[0].Y = pntArray[0].Y;<BR> pntArrayLight[1].X = pntArray[1].X;<BR> pntArrayLight[1].Y = pntArray[1].Y+8;<BR> pntArrayLight[2].X = pntArray[2].X-8;<BR> pntArrayLight[2].Y = pntArray[2].Y;<BR> pntArrayLight[3].X = pntArray[3].X;<BR> pntArrayLight[3].Y = pntArray[3].Y-8;<BR> grpLight = new GraphicsPath(pntArrayLight, bytArray);<BR><BR> //Test Drop Shadow<BR> objGrx.DrawLine(new Pen(new SolidBrush(Color.FromArgb(75, Color.Black)), (float) 10), new Point(pntArray[2].X+4, pntArray[2].Y), new Point(pntArray[3].X, pntArray[3].Y+4));<BR> //End Drop Shadow<BR><BR> objGrx.FillPath(Brushes.Black, new GraphicsPath(pntArrayBlack, bytArray)); <BR> pthDiamond = new GraphicsPath(pntArray, bytArray);<BR> lgBrush = new LinearGradientBrush(new Rectangle(pntArray[0].X, pntArray[0].Y, 70, 70), Color.DarkRed, Color.Crimson, LinearGradientMode.BackwardDiagonal);<BR> lgBrush.GammaCorrection = true;<BR> objGrx.FillPath(lgBrush, pthDiamond); <BR><BR> objGrx.FillPath(new SolidBrush(Color.FromArgb(75, 255, 0, 0)), grpLight);<BR> objGrx.DrawLine(new Pen(new SolidBrush(Color.FromArgb(100, 255, 255, 255)), 3), pntArrayLight[0], pntArrayLight[1]);<BR> break;<BR> case 1: //Grey Diamonds<BR> pntArrayBlack[0].X = pntArray[0].X - 4;<BR> pntArrayBlack[0].Y = pntArray[0].Y;<BR> pntArrayBlack[1].X = pntArray[1].X;<BR> pntArrayBlack[1].Y = pntArray[1].Y - 4;<BR> pntArrayBlack[2].X = pntArray[2].X + 4;<BR> pntArrayBlack[2].Y = pntArray[2].Y;<BR> pntArrayBlack[3].X = pntArray[3].X;<BR> pntArrayBlack[3].Y = pntArray[3].Y + 4;<BR> pthDiamond = new GraphicsPath(pntArray, bytArray);<BR><BR><BR> pntArrayLight[0].X = pntArray[0].X+8;<BR> pntArrayLight[0].Y = pntArray[0].Y;<BR> pntArrayLight[1].X = pntArray[1].X;<BR> pntArrayLight[1].Y = pntArray[1].Y+8;<BR> pntArrayLight[2].X = pntArray[2].X-8;<BR> pntArrayLight[2].Y = pntArray[2].Y;<BR> pntArrayLight[3].X = pntArray[3].X;<BR> pntArrayLight[3].Y = pntArray[3].Y-8;<BR> grpLight = new GraphicsPath(pntArrayLight, bytArray);<BR> <BR> //Test Drop Shadow<BR> objGrx.DrawLine(new Pen(new SolidBrush(Color.FromArgb(75, Color.Black)), (float) 10), new Point(pntArray[2].X+4, pntArray[2].Y), new Point(pntArray[3].X, pntArray[3].Y+4));<BR> //End Drop Shadow<BR><BR> lgBrush = new LinearGradientBrush(new Rectangle(pntArray[0].X, pntArray[0].Y, 70, 70), Color.DarkSlateGray, Color.WhiteSmoke, LinearGradientMode.BackwardDiagonal);<BR> lgBrush.GammaCorrection = true;<BR> <BR> <BR> objGrx.FillPath(new SolidBrush(Color.Black), new GraphicsPath(pntArrayBlack, bytArray));<BR> objGrx.FillPath(lgBrush, pthDiamond); <BR><BR> objGrx.FillPath(new SolidBrush(Color.FromArgb(50, 255, 255, 255)), grpLight);<BR> objGrx.DrawLine(new Pen(new SolidBrush(Color.FromArgb(100, 255, 255, 255)), 3), pntArrayLight[0], pntArrayLight[1]);<BR><BR> break;<BR> case 2:<BR> for(j=0;j<=3;j++)<BR> {<BR> pntArray[j].X -= 45;<BR> pntArray[j].Y -= 45;<BR> }<BR> goto case 1;<BR> case 3:<BR> for(j=0;j<=3;j++)<BR> {<BR> pntArray[j].X -= 45;<BR> pntArray[j].Y += 45;<BR> }<BR> goto case 1;<BR> case 4:<BR> for(j=0;j<=3;j++)<BR> {<BR> pntArray[j].X += 45;<BR> pntArray[j].Y += 45;<BR> }<BR> goto case 1;<BR> case 5:<BR> goto case 4;<BR> case 6:<BR> for(j=0;j<=3;j++)<BR> {<BR> pntArray[j].X += 45;<BR> pntArray[j].Y -= 45;<BR> }<BR> goto case 1;<BR> case 7:<BR> goto case 6;<BR> case 8:<BR> for(j=0;j<=3;j++)<BR> {<BR> pntArray[j].Y -= 90;<BR> }<BR> goto case 0;<BR> case 9:<BR> for(j=0;j<=3;j++)<BR> {<BR> pntArray[j].X -= 90;<BR> }<BR> goto case 1;<BR> }<BR> } <BR> }<BR><BR> private void drawLogoBackground()<BR> {<BR> //Dark Blue Back<BR> objGrx.FillRectangle(brsDarkBlue, 0, 0, 700, 300);<BR><BR> //Logo Conatiner<BR> Point[] pntArrayContainer = {new Point(150, 10),<BR> new Point(640, 10),<BR> new Point(690, 60),<BR> new Point(690, 240),<BR> new Point(640, 290),<BR> new Point(150, 290)};<BR> byte[] bytArrayContainer = {(byte)PathPointType.Start,<BR> (byte)PathPointType.Line,<BR> (byte)PathPointType.Line,<BR> (byte)PathPointType.Line,<BR> (byte)PathPointType.Line,<BR> (byte)PathPointType.Line};<BR> <BR> GraphicsPath grpContainer = new GraphicsPath(pntArrayContainer, bytArrayContainer);<BR><BR> objGrx.FillPath(lgbBlackBlue, grpContainer);<BR><BR> GraphicsPath myPath = new GraphicsPath();<BR> //Path is Circle<BR> myPath.AddEllipse(10, 10, 280, 280);<BR> //PathGradientBrush Constructor with Specified Path<BR> PathGradientBrush pthGrBrush = new PathGradientBrush(myPath);<BR> //Set the Center Color<BR> pthGrBrush.CenterColorWell, thanks for the effort I guess... I don't feel like I'm in any better shape than I was in before. I'm looking for some in depth discussion of the mechanics of how the engine builds stuff. For example imagine a graphic that looked like this (where each letter was a pixel):<BR><BR>BBBbbbbbbbbbbbbbbbbbbbbbbbbBBBBBBBB<BR>BBBbbbbbbbbbbbbbbbbbbbbbbbbBBBBBBBB<BR>BBBbbbbbbbbbbbbbbbbbbbbbbbbBBBBBBBB<BR>BBBbbbbbbbbbbbbbbbbbbbbbbbbBBBBBBBB<BR><BR>B in this case is a darker blue like #0851A5 and b is a lighter blue like 4271B5. Now if I were to pull up photoshop, set up those 2 colors, color in each of the pixels, and save it as an optimized GIF, the image looks fine. Use ASP.NET graphics to draw 3 filled areas with the same 2 colors, save it as a gif, and it gets all screwy. Change it to a jpeg...it's better but still different. This is a specific example, sure, but it's hard to do anything complicated when something so simple won't come out the way you want it.<BR><BR>Anyway, still searching for a good place where I can get some real answers on this.Look at the method, sendImageToOutput(), in my code. You will see that I use an EncodingParamter to specify the image quality of the JPEG. There are other Encoders that can be defined to specify different attribute of an image, based on the Codec that you are using. I was running into the same problem you are describing: my image did not look very sharp. It took me an entire day to find ANY info on this, and the info was sparse at best. You can use Encoders to specify Quality, ColorDepth, Compression, etc. If you look for info on GDI, much of it still applies, in theory, to GDI+, which the System.Drawing and System.Imaging Namespaces use in the Framework.Well...quality 100 fixed the simple problem as described above, sure enough. Thanks for the tip on that, sounds like you've been through much of the same as me. Now on to the fun stuff =""BRoyCheck out some of the articles at:<BR>http://aspalliance.com/chrisg/default.asp?category=6<BR><BR>There are some very interesting articles, like creating transparent GIFs, reading animated GIFs, altering JPEG compression rates on images, etc.<BR><BR>Also, if you want to see a more practical use of dynamic images in ASP.NET, check out:<BR>http://msdn.microsoft.com/msdnmag/issues/02/02/ASPDraw/ASPDraw.asp<BR>-and-<BR>http://www.4guysfromrolla.com/webtech/chapters/ASPNET2/ch02.4.shtml<BR><BR>hth