LEADTOOLS Support
Imaging
Imaging SDK Questions
How do I use AntiAlias in the LEAD.Wrapper code in V13
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, March 23, 2006 5:23:26 AM(UTC)
Groups: Registered
Posts: 2
We ship a product that uses LeadTools V13 and I want to add the ability to AntiAlias a image for export. I am able to get our image to a LEAD bitmap and then I want to use the Wrappers to manipulate the image then get it back to .NET for display in a picture box control. This is what I have:
LEAD.Drawing.Bitmap bmp =
new LEAD.Drawing.Bitmap(this.mapControl1.Map.Size.Width, this.mapControl1.Map.Size.Height,
LEAD.Drawing.Imaging.PixelFormat.Format24bppBgr);
System.Drawing.Graphics g = bmp.GetGraphics();
myObject.Draw(g, new System.Drawing.Rectangle(new System.Drawing.Point(0,0), mapControl1.Map.Size), true);
bmp.ReleaseGraphics(g);
LEAD.Wrapper.Ltkrn.BITMAPHANDLE hBmp = bmp.GetLeadBitmap(0);
int ret = LEAD.Wrapper.Ltimg.L_AntiAliasBitmap(ref hBmp, 4, 1, 0);
System.Drawing.Bitmap bmp2 = System.Drawing.Image.FromHbitmap(LEAD.Wrapper.Ltkrn.L_ConvertToDIB(ref hBmp));
this.pictureBox1.Image = bmp2;
The function fails on the contruction of the bmp2 object using FromHBitmap. The docs all lead me to beleive that the DIB method should work, is this the correct method?
Thanks.
#2
Posted
:
Monday, March 27, 2006 8:09:39 AM(UTC)
Groups: Manager, Tech Support
Posts: 367
Was thanked: 1 time(s) in 1 post(s)
Instead of directly calling the Wrapper, the documented way to do this is to use the following:
1. The LEAD.Drawing.Imaging.ImageProcessing.ImageProcessing.AntiAlias Method to do image processing.
2. The LEAD.Drawing.Bitmap.ToImage to convert to a System.Drawing.Image
Is there a reason you want to use the wrapper?
Amin Dodin
Senior Support Engineer
LEAD Technologies, Inc.
#3
Posted
:
Tuesday, March 28, 2006 2:42:45 AM(UTC)
Groups: Registered
Posts: 2
I don't need to use the wrappers, thanks. I did do the above but I don;t see any results. Here is my code:
LEAD.Drawing.Imaging.ImageProcessing.ImageProcessing imgp =
new LEAD.Drawing.Imaging.ImageProcessing.ImageProcessing();
imgp.AntiAlias(bmp, 4, 1, LEAD.Drawing.Imaging.ImageProcessing.ImageProcessing.AntiAliasFilterConstants.Diagonal);
this.pictureBox1.Image = bmp.ToImage();
But the image in the picturebox is the same as the original. Am I missing a step. Also I can't find documentation on any of this, where are these methods documented?
Thanks again.
#4
Posted
:
Sunday, April 2, 2006 9:42:38 AM(UTC)
Groups: Manager, Tech Support
Posts: 367
Was thanked: 1 time(s) in 1 post(s)
The classes are documented in the LEADTOOLS 13 .NET help file. In the Start Menu for LEADTOOLS, its link should be:
Raster Imaging Pro->DOTNET->LEADTOOLS DOTNET Helpfile
To find the "ImageProcessing.AntiAlias Method" help topic, type the following in the index:
AntiAlias method
Amin Dodin
Senior Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
Imaging
Imaging SDK Questions
How do I use AntiAlias in the LEAD.Wrapper code in V13
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.