Rank: Member
Groups: Member
Joined: 10/7/2005(UTC) Posts: 10
|
Though this forum seems dead, and my few questions waiting for a long time without any attention, I decided to post another question, hoping the mercy of Andrew or Fedor whom are the only persons could be answer this question. This is my ASP code Code:<%
Dim intOpacity
Dim intColor
intOpacity = 255
newColor = &hFF0E0304
newColor2 = &h0000FF
Set objcolor = Server.CreateObject("GraphicsMill.Color")
h_color = objcolor.getHue(newColor)
s_color = objcolor.getSaturation(newColor)
l_color = objcolor.getLightness(newColor)
intColor = "&hFFFFFFFF"
Dim objGuitarBitmap ' File containing the guitar image
Dim objMask ' File containing the guitar body mask
Dim objColorLayer ' Colored layer which will be blended with original image
Set objGuitarBitmap = Server.CreateObject("GraphicsMill.Bitmap")
Set objGuitarBitmap1 = Server.CreateObject("GraphicsMill.Bitmap")
Set objGuitarBitmap2 = Server.CreateObject("GraphicsMill.Bitmap")
Set objGuitarBitmap3 = Server.CreateObject("GraphicsMill.Bitmap")
Set objGuitarBitmap4 = Server.CreateObject("GraphicsMill.Bitmap")
Set objGuitarBitmap5 = Server.CreateObject("GraphicsMill.Bitmap")
Set objMask = Server.CreateObject("GraphicsMill.Bitmap")
Set objColorLayer = Server.CreateObject("GraphicsMill.Bitmap")
' Load the original file and the mask
objGuitarBitmap5.LoadFromFile Server.MapPath("obj_color4.png")
objGuitarBitmap4.LoadFromFile Server.MapPath("obj_color3.png")
objGuitarBitmap3.LoadFromFile Server.MapPath("obj_color2.png")
objGuitarBitmap2.LoadFromFile Server.MapPath("obj_color1.png")
objGuitarBitmap1.LoadFromFile Server.MapPath("obj_color.png")
objGuitarBitmap.LoadFromFile Server.MapPath("walnut2.jpg")
objMask.LoadFromFile Server.MapPath("test_obj_mask.jpg")
objGuitarBitmap2.adjustHSL objcolor.getHue(newColor2), objcolor.getSaturation(newColor2), objcolor.getLightness(newColor2)
' Creating the color layer. It should be of the same size as mask
objColorLayer.CreateNew objMask.Width, objMask.Height, Format32bppArgb, intColor
' Use the mask as an alpha channel for the color layer. Now when we try to
' alpha blend objColorLayer with objGuitarBitmap, colors will be blended
' according to the mask
' Blend
objGuitarBitmap1.DrawOnBitmap objGuitarBitmap, , , , , , , , , 1, 120
objGuitarBitmap5.DrawOnBitmap objGuitarBitmap, , , , , , , , , 1, intOpacity
objGuitarBitmap4.DrawOnBitmap objGuitarBitmap, , , , , , , , , 1, intOpacity
objGuitarBitmap3.DrawOnBitmap objGuitarBitmap, , , , , , , , , 1, intOpacity
objGuitarBitmap2.DrawOnBitmap objGuitarBitmap, , , , , , , , , 1, intOpacity
objColorLayer.Replace objMask, 3
objColorLayer.DrawOnBitmap objGuitarBitmap, , , , , , , , , 1, intOpacity
objGuitarBitmap.AddAlpha
objGuitarBitmap.Transparentize &hFFFDFDFD,10
objGuitarBitmap.Formats.SelectCurrent "PNG"
objGuitarBitmap.SaveToFile Server.MapPath("SaveToPng1.png")
objGuitarBitmap.SaveToStream Response
%>
Though I am setting the color value to '0000FF', Final Images Color value has changed to 'FC7EFC'. Can somebody explain this please? -Nishanthe Edited by user Sunday, December 23, 2007 4:36:29 PM(UTC)
| Reason: Not specified
|