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

Notification

Icon
Error

Options
Go to last post Go to first unread
kaitsu  
#1 Posted : Wednesday, March 02, 2005 4:15:00 PM(UTC)
kaitsu

Rank: Member

Groups: Member
Joined: 3/2/2005(UTC)
Posts: 4

Hi, I am trying to convert bitmaps to swf and define one color to be transparent in the resulting swf file. For example, I have a jpg image with a logo and white background and I would like the white background to be transparent on the swf. How should I do that? I tried using:
Code:
Dim objBitmap
'Create Bitmap object
Set objBitmap = Server.CreateObject("GraphicsMill.Bitmap")
					 
'Load image from file
objBitmap.LoadFromFile FromFile

objBitmap.ApplyInPlace = True
objBitmap.Data.ApplyInPlace = True
'objBitmap.Data.ConvertTo32bppArgb
objBitmap.Data.ConvertTo24bppRgb False
objBitmap.Data.Channels.Transparentize ColorWhite, 0
'objBitmap.Palette.SetTransparentColor ColorWhite
					 
'Set SWF as Current format
objBitmap.Formats.SelectCurrent "SWF"


'Save image to file
objBitmap.SaveToFile ToFile
but it did not work... Please let me know the way to do this. Thanks, Kai

Edited by user Monday, December 24, 2007 4:06:04 PM(UTC)  | Reason: Not specified

kaitsu  
#2 Posted : Sunday, March 06, 2005 2:57:00 AM(UTC)
kaitsu

Rank: Member

Groups: Member
Joined: 3/2/2005(UTC)
Posts: 4

Andrew, Thanks for your reply to my email. I tried to email you back, but the emails keep bouncing back to me. Could you please post a code example how to I can do this..? Thanks, Kai
kaitsu  
#3 Posted : Tuesday, March 08, 2005 1:51:00 AM(UTC)
kaitsu

Rank: Member

Groups: Member
Joined: 3/2/2005(UTC)
Posts: 4

Anyone here?
Andrew  
#4 Posted : Wednesday, March 09, 2005 5:39:00 PM(UTC)
Andrew

Rank: Advanced Member

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

Thanks: 2 times
Was thanked: 25 time(s) in 25 post(s)
Hi Kai, Please excuse me for a delay with answer. Try to use the following code:
Code:
<%
Dim objBitmap

Set objBitmap = Server.CreateObject("GraphicsMill.Bitmap")

Dim FromFile
FromFile = "c:\[test files]\file.jpg"
objBitmap.LoadFromFile FromFile

objBitmap.ApplyInPlace = True
objBitmap.Data.ApplyInPlace = True

objBitmap.Data.Channels.Transparentize &hFFFFFFFF, 30

'Set SWF as Current format
objBitmap.FormatAutoSelect = False
objBitmap.Formats.SelectCurrent "SWF"

'Set SWF compressions settings:
' I specified green background to check the transparency 
objBitmap.Formats.SwfBackgroundColor = &hFF00FF00
' Specify the lossless compression
objBitmap.Formats.SwfCompressionType = 0

Dim ToFile
ToFile = "c:\temp\1.swf"
objBitmap.SaveToFile ToFile
%>
Hope this helps.

Edited by user Friday, May 23, 2008 3:05:42 PM(UTC)  | Reason: Not specified

kaitsu  
#5 Posted : Thursday, March 10, 2005 4:36:00 PM(UTC)
kaitsu

Rank: Member

Groups: Member
Joined: 3/2/2005(UTC)
Posts: 4

Hi, Thanks for the reply. I tried the example code, but the images do not seem to have anything transparent in them, nor does the background color change. Did you try this your self? I did try to modify the code and was able to make black color change to white, but that's all. Thanks, Kai
Andrew  
#6 Posted : Thursday, March 10, 2005 7:24:00 PM(UTC)
Andrew

Rank: Advanced Member

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

Thanks: 2 times
Was thanked: 25 time(s) in 25 post(s)
> Thanks for the reply. I tried the example code, but the images do not seem to have anything transparent in them, nor does the background color change. Did you try this your self? I did and it working fine for me. Could you submit case withan example of input image?

Edited by user Friday, May 23, 2008 3:06:13 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.