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

Notification

Icon
Error

Options
Go to last post Go to first unread
rborrallo  
#1 Posted : Monday, November 8, 2004 5:11:00 PM(UTC)
rborrallo

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

Andrew  
#2 Posted : Monday, November 8, 2004 5:26:00 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)
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

rborrallo  
#3 Posted : Monday, November 8, 2004 6:26:00 PM(UTC)
rborrallo

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.

Andrew  
#4 Posted : Thursday, November 11, 2004 12:25:00 AM(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)
We did not receive files from you. Could you resend it again?
Andrew  
#5 Posted : Thursday, November 11, 2004 4:53:00 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)
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

rborrallo  
#6 Posted : Thursday, November 11, 2004 8:01:00 PM(UTC)
rborrallo

Rank: Member

Groups: Member
Joined: 11/8/2004(UTC)
Posts: 3

Thanks Andrew. Now it works fine.
bodygard  
#7 Posted : Saturday, February 5, 2005 9:38:00 AM(UTC)
bodygard

Rank: Member

Groups: Member
Joined: 1/12/2005(UTC)
Posts: 4

can i overlay animated gif in a bitmapviewer.bitmap image?
Andrew  
#8 Posted : Sunday, February 6, 2005 11:41:00 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)
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.

Users browsing this topic
Guest
Similar Topics
Working with transparent images (Other Products)
by BarryP 3/23/2006 3:12:53 PM(UTC)
HOWTO: Saving semi-transparent images into file formats which does not support alpha channel. (FAQ - Frequently Asked Questions)
by Fedor 7/20/2003 9:13:00 PM(UTC)
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.