Jump to content
Xtreme .Net Talk

XeroCode

Members
  • Posts

    5
  • Joined

  • Last visited

About XeroCode

  • Birthday 10/30/1981

Personal Information

  • Occupation
    Programmer, Chef
  • Visual Studio .NET Version
    ASP.NET Framework 1.1.4
  • .NET Preferred Language
    VB.Net

XeroCode's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Ok, the code above is perfectly clean, the problem that I discovered is that GDI+ understands color.black as the HEX value #000000, is there anyway for me to set it up that GDI would look for all values resembeling the color black? For instance, #242727. Also, is there anyway to set the .newColor dynamically, for instance, connecting to a Database, grabing the appropriate HEX value and input it into the .NewColor? Maybe using ColorTranslator.FromHTML() ? Thanks in advance
  2. Are you just trying to display all values of the array or specific values from the array?
  3. If you are creating a web based application and speed is a major issue (Which normally it is) the current installment of GDI does NOT take advantage of any hardware acceleration, if my memory serves me correctly. You may want to look into a DirectX component as far as speed is concerned
  4. I am working with GDI+ using its colormap constructor, problem is when GDI pulls in the image to recolor its doing it backwards. The images I pull in are .PNG line art images and the actual line art is black, however when i try to replace the black lines with say, green, my script colors the background not the actual line art! Heres my code: <%@Page Language="vb" debug="true"%> <%@import NameSpace = "System.Drawing"%> <%@import NameSpace = "System.Drawing.Graphics"%> <%@import NameSpace = "System.Drawing.Text"%> <%@import NameSpace = "System.Drawing.Imaging"%> <%@import NameSpace = "System.Drawing.Drawing2D"%> <% Response.Clear() Dim strImgPath as String = "../images/clipart/xero.png" Dim orgImage As System.Drawing.Image = System.Drawing.Image.FromFile(server.mappath(strImgPath)) Dim swpImage as New Bitmap(orgImage) Dim g as Graphics = Graphics.FromImage(swpImage) Dim clrMap(0) As System.Drawing.Imaging.ColorMap clrMap(0) = new System.Drawing.Imaging.ColorMap() clrMap(0).OldColor = color.black clrMap(0).NewColor = Color.green Dim attr As ImageAttributes = New ImageAttributes() attr.SetRemapTable(clrMap) Dim rec as New Rectangle(0,0,swpImage.width, swpImage.height) g.drawImage(swpImage, rec,0,0,swpImage.Width, swpImage.Height, GraphicsUnit.Pixel, attr) swpImage.Save(Response.OutputStream, ImageFormat.gif) %> The extra namespaces are in there for code that I have to add later. Any help with this would be greatly appreciated.
  5. I hope someone can help me out with this (or another function that will take X color and replace it with X color) , this seems to be something that noone has really written about on the Net. I am writing a design application in which a user can add custom text, colors, and images to what will eventually wind up on a T-Shirt or hat or whatever else. I am currently using GDI+ to write out the User Text in specified font using this companies list of odd color choices. What I need to do is this: There is a database of about 250 PNG line art files and what I need to do is pull the user selected image into an aspx page and if the user has selected a print color of Light Green, for instance, I need the program to change the black lines to Light Green and vice versa. Also, I need these images to be as close to print time as i can possibly make them. In the database is a list of HEX values that this company uses, I make a database connection in the script that writes out the Fonts that grabs the hex value and then i define my brush like this: Dim solidBrush as New SolidBrush(ColorTranslator.FromHtml(strColor)) Is there a way to use this with ColorMap or another function similar? Any help would be greatly appreciated!
×
×
  • Create New...