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

Notification

Icon
Error

Options
Go to last post Go to first unread
sontt  
#1 Posted : Sunday, June 04, 2006 3:10:08 PM(UTC)
sontt

Rank: Member

Groups:
Joined: 6/2/2006(UTC)
Posts: 4

Hi , I combine 2 image The small image I rotated it , made it transparent and combine it with large image But the small image can't transparent If i change the transparent to yellow => it ok but not with transparent
Code:
rotate.BackgroundColor = Aurigma.GraphicsMill.RgbColor.Transparent;
Please help me Thanks
Code:
private void AvandceCombine()
		{
			
			//Load background image
			Aurigma.GraphicsMill.Bitmap bitmap = 
				new Aurigma.GraphicsMill.Bitmap(@"D:\Program Files\Aurigma\Graphics Mill 3.5 for .NET 1.1\Web Demos Source Code\GraphicsMillWebCS\cooler.png".Replace(@"\","/"));


			//Load small image (foreground image)
			Aurigma.GraphicsMill.Bitmap smallBitmap = 
				new Aurigma.GraphicsMill.Bitmap(@"D:\Program Files\Aurigma\Graphics Mill 3.5 for .NET 1.1\Web Demos Source Code\GraphicsMillWebCS\500off.png".Replace(@"\","/"));

			PixelFormatConverter pixelFormatConverter = new PixelFormatConverter();
			pixelFormatConverter.DestinationPixelFormat = PixelFormat.Format24bppRgb;
			pixelFormatConverter.ApplyTransform(smallBitmap);

			//Rotate at 5 degrees with medium quality
			Aurigma.GraphicsMill.Transforms.Rotate rotate =
				new Aurigma.GraphicsMill.Transforms.Rotate();
			rotate.Angle = 30;
			[b]rotate.BackgroundColor = Aurigma.GraphicsMill.RgbColor.Transparent;[/b]
			rotate.InterpolationMode = Aurigma.GraphicsMill.Transforms.InterpolationMode.MediumQuality;
						
			if (rotate.IsPixelFormatSupported(PixelFormat.Format24bppRgb))
				[b]rotate.ApplyTransform(smallBitmap);[/b]

			//Draw foreground image on background with transparency
			smallBitmap.Draw(bitmap, 10, 110, 
				smallBitmap.Width, smallBitmap.Height, 
				Aurigma.GraphicsMill.Transforms.CombineMode.Alpha, 1f, 
				Aurigma.GraphicsMill.Transforms.InterpolationMode.LowQuality);

			bitmap.Save(@"C:/background.png");
			


		}

Edited by user Wednesday, December 19, 2007 4:31:00 PM(UTC)  | Reason: Not specified

sontt  
#2 Posted : Sunday, June 04, 2006 3:35:07 PM(UTC)
sontt

Rank: Member

Groups:
Joined: 6/2/2006(UTC)
Posts: 4

hi, I found solution We must use "PixelFormat.Format32bppArgb" instead PixelFormat.Format24bppArgb pixelFormatConverter.DestinationPixelFormat = PixelFormat.Format32bppArgb; This's great tool Thanks
Dmitry  
#3 Posted : Sunday, June 04, 2006 4:43:46 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello, It is very pleasant to read such complimentary references. Thanks.
Sincerely yours, Dmitry Sevostyanov UserPostedImage Follow Aurigma on Twitter!
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.