Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
valefar  
#1 Posted : Thursday, December 29, 2005 3:50:49 AM(UTC)
valefar

Rank: Member

Groups: Member
Joined: 12/29/2005(UTC)
Posts: 3

I'm evaluating Graphic Mill 2, and so far for the most part I'm loving it. However, there is one task that is driving me crazy.

I'm trying to create a transparent gif containing nothing but text. The problem that I am having is that the text seems to be anti-aliasing despite my efforts to stop it.

I've tried GDI+ with antialias = false. No change.
I've tried the regular GDI. No change.
I've tried converting to 8 and 4bppindexed. No change.
I've tried starting with a 24bppRgb canvas instead of 32bppRgb. That resulted in the same thing plus horizontal lines.
I've tried different dithering options (including None) when converting to 8bppIndexed. No change.

Nothing seems to provide the output that I am looking for.

When you overlay this transparent gif over any other color background, you'll see what I'm talking about. Rather than red letters with a transparent background, you get red letters with jagged pixels of other colors like it's trying to anti-alias.

Here's my code:

Code:
Set objBitmap = Server.CreateObject("GraphicsMill.Bitmap")
objBitmap.Unit = 0

With objBitmap.Graphics 
	.Engine = DrawingEngineGdi
	'.Engine = DrawingEngineGdiplus

	.TextFormat.FontName = "Arial"
	.TextFormat.FontColor = ColorRed
	.TextFormat.FontSize = 22
	.TextFormat.IsBold = True

	strText = "Some Random Text"

	TextWidth = .TextFormat.MeasureTextWidth(strText)
	TextHeight = .TextFormat.MeasureTextHeight(strText)

	objBitmap.CreateNew TextWidth, TextHeight, Format32bppRgb, &hFFFFFFFF
	
	.DrawText strText, 0, 0
End With

objBitmap.Data.ConvertTo8bppIndexed DitheringTypeNone
objBitmap.Data.Palette.SetTransparentColor &hFFFFFFFF
objBitmap.FormatAutoSelect = False
objBitmap.Formats.SelectCurrent ("GIF")
objBitmap.IsLzwEnabled = True
objBitmap.Formats.GifIsTransparent = True

objBitmap.SaveToStream Response


Please advise. I obviously don't want this result. :)

Edited by user Sunday, December 23, 2007 4:39:32 PM(UTC)  | Reason: Not specified

Andrew  
#2 Posted : Friday, January 6, 2006 1:18:25 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
When I added

Code:
	.Antialiasing = False 


into the Graphics initialization code, it worked as expected. Check it out again.

Edited by user Sunday, December 23, 2007 4:39:44 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.