Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, June 16, 2013 10:40:30 AM(UTC)
wangbill18

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
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, June 16, 2013 10:43:48 AM(UTC)
wangbill18

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)

mohamed  
mohamed

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.

LEAD Logo
 
#4 Posted : Monday, June 17, 2013 3:14:10 PM(UTC)
wangbill18

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)

mohamed  
mohamed

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.
File Attachment(s):
Transparent_Stamp.zip (1,218kb) downloaded 39 time(s).
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.076 seconds.