Rank: Member
Groups: Member
Joined: 11/8/2004(UTC) Posts: 3
|
Hello, I'm reading transparent PNG images and overlaying them. But the result has a black background. I dont know what is happening. Here is my code. Code:Set objBitmap = Server.CreateObject("GraphicsMill.BitMap")
objBitMap.LoadFromFile Server.MapPath ("1.png")
Set objBitmap2 = Server.CreateObject("GraphicsMill.BitMap")
objBitMap2.LoadFromFile Server.MapPath ("2.png")
objBitmap.DrawOnBitMap objBitMap2,0,0
objBitMap2.SaveToFile Server.MapPath("oi.png")
Thanks in advance. Edited by user Monday, December 24, 2007 4:28:07 PM(UTC)
| Reason: Not specified
|
|
|
|
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)
|
You should specify alpha blending combine mode in DrawOnBitmap method. By default it just copies pixels instead of alpha blending. So use this code: objBitmap.DrawOnBitMap objBitMap2 0, 0, , , , , , , , 1 If it won't help, please submit case with your PNG files. Edited by user Friday, May 23, 2008 3:48:17 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Member
Groups: Member
Joined: 11/8/2004(UTC) Posts: 3
|
I have sent you my images. 1.PNG is transparent but the result has a strange green background and I dont know why.
|
|
|
|
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)
|
We did not receive files from you. Could you resend it again?
|
|
|
|
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)
|
Both images are 8-bit indexed bitmaps (i.e. palette based rather than common RGB values). Indexed images cannot be alpha blended. So you should convert them to 32-bit ARGB before blending: Code:' load bitmaps ...
objBitmap1.Data.ConvertTo32bppArgb
objBitmap2.Data.ConvertTo32bppArgb
' blend bitmaps...
This should help. Edited by user Monday, December 24, 2007 4:29:17 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Member
Groups: Member
Joined: 11/8/2004(UTC) Posts: 3
|
Thanks Andrew. Now it works fine.
|
|
|
|
Rank: Member
Groups: Member
Joined: 1/12/2005(UTC) Posts: 4
|
can i overlay animated gif in a bitmapviewer.bitmap image?
|
|
|
|
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)
|
Hello,
This feature is not supported directly (i.e. you cannot just specify the GIF file and control start displaying it). However you can manually draw frames of the animated GIF on the bitmap.
Hope this helps.
|
|
|
|
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.