PDA

View Full Version : Why SetIntParameter is wrong ?



vdtk3
October 1, 2012, 04:59:17
Hi !
I'm using IC Imaging Control .Net for Visual C++ .NET. Now i using the frame Filter to set ROIFilter.
My code for set ROIFilter is following:

private: System::Void btSelect_Click(System::Object^ sender, System::EventArgs^ e)
{
int W,H;
W = userROI.right - userROI.left;
H = userROI.botton - userROI.top;

icImagingControl2->LiveStop();
if (!icImagingControl2->LiveVideoRunning)
{
ROIFilter->BeginParameterTransfer();

ROIFilter->SetIntParameter("Left",userROI.left);
ROIFilter->SetIntParameter("Top",userROI.top);
ROIFilter->SetIntParameter("Width",W);
ROIFilter->SetIntParameter("Height",H);


ROIFilter->EndParameterTransfer();
}
icImagingControl2->LiveStart();
}

Now ROIFilter->SetIntParameter don't implement exactly.
I show it in following the Images :

//Red is region i want to set ROI

1523

//But when implement set ROIfilter by above Source code is result :
1524

anyone can tell me why ?

Thanks !

Stefan Geissler
October 15, 2012, 10:15:52
Hello,

It looks to me, like the ROI was moved 20 pixels to the left. This may happens, because the IC Imaging Control window is not in the 0/0 position of your main window. Therefore, make sure, the mouse coordinates you get match to the correct window position of your application.

vdtk3
November 2, 2012, 10:26:14
Hi !
I'm sure that the mouse poisition get match the correct coordinate window, I have many test and see that in once of test is have difference to moved pixel. You can see my GUI, Pleasea tell me.
1527

1528
Thanks !

Michael Kirmse
November 2, 2012, 11:58:39
Hello,

it really looks like the ROI is set to far to the right, because the offset of the imaging control to the window border is missing in the calculation. Please check every value you pass to the ROI again.
It is often helpful to write a small sample program that only implements the functionality that you need to reproduce the issue.
If you have tried this and still face the problem, please send such a small sample to support(at)imagingcontrol.com.