Thanks Maen,
I tried your logic. It is not working in desired manner.
I remind you, I am using Visual Basic 6 with LT 14
'-----------------CODE-------------------------------------------------------------------------
Option Explicit
Dim rasterIO As LEADRasterIO
Dim rasterProc As leadRasterProcess
Private Sub Form_Load()
Set rasterIO = New LEADRasterIO
Set rasterProc = New leadRasterProcess
cmdLoad_Click
End Sub
Private Sub cmdLoad_Click()
leadRasterMain.Raster.Bitmap = 0
rasterIO.Load leadRasterMain.Raster, App.Path & "\ExtraImages\DSCN0007.JPG", 0, 0, 1
leadRasterProcess.Raster.Bitmap = leadRasterMain.Raster.Bitmap
End Sub
Private Sub cmdSubtract_Click()
rasterProc.EdgeDetectEffect leadRasterMain.Raster, 50, 0, EDGE_SOLID
'leadRasterMain.Raster.SetRgnMagicWand 0, 0, RGB(255, 255, 255), RGB(0, 0, 0), L_RGN_SETNOT
leadRasterMain.Raster.SetRgnMagicWand 0, 0, 0, 10, L_RGN_SETNOT
rasterProc.Fill leadRasterMain.Raster, RGB(255, 255, 255)
rasterProc.CombineExt leadRasterMain.Raster, _
leadRasterMain.DstLeft, leadRasterMain.DstTop, _
leadRasterMain.DstWidth, leadRasterMain.DstHeight, _
leadRasterProcess.Raster, _
leadRasterProcess.SrcLeft, _
leadRasterProcess.SrcTop, CB_OP_ADD
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Set rasterIO = Nothing
Set rasterProc = Nothing
End Sub
'-----------------END CODE-------------------------------------------------------------------
On my machine, leadtools asks for two extra parameters crLowerTolerence and crUpperTolerence with databype OLE_COLOR.
You can see those two extra parameters to SetRgnMagicWand method bold, underlined and in brown color in above code. I tried many combinations of these parameters. Am I setting those parameters wrong ?
When I run above code, instead of turning background to white, it is turning actual image area to white (and background to black).
My request is Copy above code to your project, Make necessary changes, Incluse corrected code in my reply.
Waiting for reply.
Thanks