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 : Thursday, August 2, 2007 1:48:33 AM(UTC)

manju  
manju

Groups: Registered
Posts: 49


Hi,

I have attached three images named salve.jpg and mask.gif from these two images i want to make third image i.e MaskedImage.jpg,so is there any way to do that i.e. is there any tool in leadtool 15 that allow me to provide a mask of any shape to an image so that only masked part of image is visible.I am using leadtool 15 and c# .net.
Please reply soon.

Thanks
Manju
File Attachment(s):
Images.rar (225kb) downloaded 21 time(s).
 

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 : Monday, August 6, 2007 4:25:55 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

Manju,
You can do this as follows:
Leadtools.Codecs.RasterCodecs.Startup();
Leadtools.Codecs.RasterCodecs rasterCodecs = new Leadtools.Codecs.RasterCodecs();

rasterImageViewer1.Image = rasterCodecs.Load("mask.gif", 24, Leadtools.Codecs.CodecsLoadByteOrder.Bgr, 1, 1);
MessageBox.Show("this is the mask image");
Leadtools.ImageProcessing.Color.IntensityDetectCommand intDtct = new Leadtools.ImageProcessing.Color.IntensityDetectCommand(128, 255, new Leadtools.RasterColor(Color.White), new Leadtools.RasterColor(Color.Black), Leadtools.ImageProcessing.Color.IntensityDetectCommandFlags.Master);
intDtct.Run(rasterImageViewer1.Image);
MessageBox.Show("The mask image converted to black and white, but kept 24-bit");
Leadtools.RasterImage imgMask = rasterImageViewer1.Image.Clone();
rasterImageViewer1.Image = rasterCodecs.Load("slave.jpg", imgMask.Width, imgMask.Height, 24, Leadtools.RasterSizeFlags.Resample, Leadtools.Codecs.CodecsLoadByteOrder.Bgr);
MessageBox.Show("The slave image resized");
Leadtools.Codecs.RasterCodecs.Shutdown();
Leadtools.ImageProcessing.CombineFastCommand combineFast = new Leadtools.ImageProcessing.CombineFastCommand(rasterImageViewer1.Image, new Rectangle(0, 0, rasterImageViewer1.Image.Width, rasterImageViewer1.Image.Height), new Point(0, 0), Leadtools.ImageProcessing.CombineFastCommandFlags.OperationAdd);
combineFast.Run(imgMask);
MessageBox.Show("The slave image after combine");

Amin Dodin

Senior 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.103 seconds.