Aurigma Forums
»
Legacy Products
»
Archive
»
Other Products
»
Bitmap to SWF with specified color transparent
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
|
|
|
|
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
|
|
|
|
Rank: Member
Groups: Member
Joined: 3/2/2005(UTC) Posts: 4
|
|
|
|
|
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)
|
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
|
|
|
|
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
|
|
|
|
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)
|
> 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
|
|
|
|
Aurigma Forums
»
Legacy Products
»
Archive
»
Other Products
»
Bitmap to SWF with specified color transparent
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.