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, March 23, 2006 5:28:26 AM(UTC)

Citrit  
Citrit

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.

 

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, March 27, 2006 8:14:39 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 354


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.
LEAD Logo
 
#3 Posted : Tuesday, March 28, 2006 2:47:45 AM(UTC)

Citrit  
Citrit

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:47:38 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 354


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.
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-2019, Yet Another Forum.NET
This page was generated in 0.150 seconds.