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 : Tuesday, August 17, 2010 9:16:12 PM(UTC)

anjana  
anjana

Groups: Registered
Posts: 3


Could someone provide me some sample source on using Magicwand functionality using Leadtools API version 15
 

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 : Wednesday, August 18, 2010 3:04:37 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

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

Do you mean you want to use L_SetBitmapRgnMagicWand? If yes, here's this sample code from our API help file:

L_INT SetBitmapRgnMagicWandExample(pBITMAPHANDLE  pBitmap,
                                                   L_HWND           hWnd,
                                                   L_INT          x,
                                                   L_INT          y)
{
   L_INT nRet;
   RGNXFORM XForm;

   nRet = L_PointToBitmap(pBitmap, TOP_LEFT, &x, &y);
   if(nRet != SUCCESS)
      return nRet;
   if(L_BitmapHasRgn(pBitmap))
      nRet = L_SetBitmapRgnMagicWand(pBitmap, x, y, (20,30,15),(15,30,10), L_RGN_OR);
   else
      nRet = L_SetBitmapRgnMagicWand(pBitmap, x, y, (20,30,15),(15,30,10), L_RGN_SET);
   if(nRet == SUCCESS)
   {
      if(L_BitmapHasRgn(pBitmap))
      {
         HDC hDC=GetDC(hWnd);
         XForm.uViewPerspective=TOP_LEFT;
         XForm.nXScalarNum=1;
         XForm.nXScalarDen=1;
         XForm.nYScalarNum=1;
         XForm.nYScalarDen=1;

         XForm.nXOffset=0;
         XForm.nYOffset=0;
         L_FrameBitmapRgn(hDC, pBitmap, &XForm, 3);
         ReleaseDC(hWnd, hDC);
      }
      else
      {
         MessageBox(hWnd, TEXT("no rgn"), TEXT("error"), MB_OK);
         return nRet;
      }
   }
   return SUCCESS;
}


Please see the help topic "L_SetBitmapRgnMagicWand" for more information.

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