Rank: Member
Groups: Member
Joined: 5/23/2006(UTC) Posts: 11
|
Hi, I have included a bit of code below - it's a bit longwinded and I have cut some bits out but it still reproduces the effect I am enquiring about. The gist of it is that I am trying to set the background colour to white and make it transparent. 1) The transparency works fine in a web page, but when I load the resulting GIF into Photoshop, in is not showing as transparent, like transparent gifs that I have created using Photoshop (e.g. with the grey/white checkered background). 2) The actual background colour is coming out as 254, 254, 254 rather than 255, 255, 255 (web rgb colour values). If anyone can suggest wher4e I might be going wrong in the code, I would be very grateful. Thanks, John Campbell ASP CODE BELOW: Code: " " Then
' * See note 1 below:
pos = 4 + arrPositions(i) + .TextFormat.Abc(CurrentChar, 0) - (i * 1) + 3
.DrawArtisticText CurrentChar, pos, 6, true, false
End If
Next 'i
End With
' Draw the background text...
With objBitmapBackground.Graphics
.Engine = DrawingEngineGdiplus
.Antialiasing = true
.Unit = UnitPixel
.TextFormat.FontName = pStrFontName
.TextFormat.FontColor = .Color.CreateRGB(211, 209, 233)
.TextFormat.FontSize = FONT_SIZE
.TextFormat.IsBold = true
.Brush.PrimaryColor = .Color.CreateRGB(211, 209, 233)
.Pen.ForeColor = .Color.CreateRGB(211, 209, 233)
.Pen.Weight = 3
For i = LBound(arrPositions) To UBound(arrPositions)
CurrentChar = Mid(pStrText, i + 1, 1)
If CurrentChar " " Then
' * See note 1 above:
pos = 4 + arrPositions(i) + .TextFormat.Abc(CurrentChar, 0) - (i * 1)
.DrawArtisticText CurrentChar, pos, 0, true, true
End If
Next 'i
intActualWidth = pos + intLastCharWidth
End With
' Apply glow effect on text...
objBitmapBackground.ArtisticEffects.Glow objBitmapBackground.Graphics.Color.CreateRGB(211, 209, 233), 5, false
objBitmapForeground.ArtisticEffects.Glow objBitmapForeground.Graphics.Color.CreateRGB(209, 207, 231), 5, false
' Draw foreground image onto background with transparency
objBitmapForeground.DrawOnBitmap objBitmapBackground, , , , , , , , , CombineModeAlpha, 255
' Crop to remove excess whitespace...
objBitmapBackground.Transforms.Crop 10, 10, pIntPicWidth - 20, pIntPicHeight - 20, &h00FFFFFF
objBitmapBackground.DrawOnBitmap objBitmapActual
' Reduce Colour depth...
objBitmapActual.Data.ConvertTo24bppRgb True, &h00FFFFFF
' Set image format...
objBitmapActual.Formats.SelectCurrent "GIF"
' Set no dithering...
objBitmapActual.Data.ConvertTo8bppIndexed DitheringTypeNone, , , , 255
' Make color &h00FFFFFF full transparent...
objBitmapActual.Data.Palette.SetTransparentColor &h00FFFFFF
' Set transparancy & LZW enabled...
objBitmapActual.Formats.GifIsTransparent = true
objBitmapActual.IsLzwEnabled = true
objBitmapActual.SaveToStream Response
Set objBitmapActual = Nothing
Set objBitmapBackground = Nothing
Set objBitmapForeground = Nothing
GenerateTextBanner = true
End Function 'GenerateTextBanner(ByVal pStrSavePath, ByVal pStrText, ByVal pStrFontName, ByVal pIntPicWidth, ByVal pIntPicHeigh)
Call GenerateTextBanner("", "Expression", "Tahoma", 480, 100)
Edited by user Wednesday, December 19, 2007 4:24:25 PM(UTC)
| Reason: Not specified
|