This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Sunday, June 16, 2013 10:40:30 AM(UTC)
Groups: Registered
Posts: 50
I need burn a picture(signature) into a image. I am using automation and AnnStampObject. The transparent backgroud is lost when I burn the stamp. Could you help? Here is my code.
Dim pic As AnnPicture = New AnnPicture(Image.FromFile(signatureFilePath))
pic.TransparentMode = AnnPictureTransparentMode.TopLeftPixel
signature.Picture = pic
#2
Posted
:
Sunday, June 16, 2013 10:43:48 AM(UTC)
Groups: Registered
Posts: 50
My picture is a gif with transparent backgroud. It looks good before burn..
#3
Posted
:
Monday, June 17, 2013 2:51:26 AM(UTC)
Groups: Registered, Tech Support
Posts: 179
To burn a transparent stamp image on an image, use the following code:
+=======================================================+
AnnPicture mypic = new AnnPicture();
mypic.Image = Image.FromFile(@"C:\Users\Public\Documents\LEADTOOLS Images\LittleGFlyingAlpha.png");
AnnStampObject mystamp = new AnnStampObject();
mystamp.Picture = mypic;
mystamp.Bounds = new AnnRectangle(rasterImageViewer1.Image.Width / 2, rasterImageViewer1.Image.Height /2, 390, 390, AnnUnit.Pixel);
Leadtools.Drawing.RasterImageGdiPlusGraphicsContainer GraphicsContainer = new Leadtools.Drawing.RasterImageGdiPlusGraphicsContainer(rasterImageViewer1.Image);
mystamp.Draw(GraphicsContainer.Graphics);
+=======================================================+
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.
#4
Posted
:
Monday, June 17, 2013 3:14:10 PM(UTC)
Groups: Registered
Posts: 50
It tried your code with no success. I am using automation. I changed realize to your code. Actually before I used automation, I was using a code similar to yours without using automation. The transparent background worked fine. Is this because of automation? Thanks!
#5
Posted
:
Tuesday, June 18, 2013 3:54:41 AM(UTC)
Groups: Registered, Tech Support
Posts: 179
I tested the code again and it worked fine. I added the code under "button5_Click" function.
Please try the attached project and if the problem persists, please send me your sample images (main image and stamp image) and explain what you want the result to look like.
About using the automation, you can loop all the AnnObject and call AnnObject.Draw() method
If you send any files, make sure to put them in a ZIP or RAR file to ensure our servers deliver them correctly.
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.
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.