LEADTOOLS Support
Imaging
Imaging SDK Questions
how to realize my own Median Dialog like leadtools Median Dialog
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, October 20, 2009 11:47:26 PM(UTC)
Groups: Registered
Posts: 16
hello all:
i want to realize my own image process dialog just like that leadtools provide dialog.and i realize the dialog .but when i drag
the slider it is process very slow.for example when i do median dialog it is very slow but the median dialog that leadtools provide not slow.how can i to do.
void CImageProcessDlg::OnImageProcessSlider(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
m_bitmap.Copy(m_BeforeImage.LeadBitmap);
m_nSilder = m_SliderCtrl.GetPos();
m_strEdit.Format("%d",m_nSilder);
m_Edit.SetWindowText(m_strEdit);
switch(m_ProcessType)
{
case IMAGEMEDIAN:
m_bitmap.MedianFilter(m_nSilder);
break;
}
m_AfterImage.LeadBitmap.Copy(m_bitmap);
m_AfterImage.SetPaint();
*pResult = 0;
}
#2
Posted
:
Tuesday, October 20, 2009 11:50:15 PM(UTC)
Groups: Registered
Posts: 16
buy the way,i use the leadtool 13.and coder with VC.
thank you.
#3
Posted
:
Wednesday, October 21, 2009 6:45:40 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
It appears your OnImageProcessSlider function calls our Median function with every refresh of the display or movement of the slider.
Try to change your code so that processing is only done after the slider finishes moving.
#4
Posted
:
Wednesday, October 21, 2009 4:09:59 PM(UTC)
Groups: Registered
Posts: 16
hello Adam Boulad:
thank you for your reply.just as your say,the median fuction with every refresh of the display or movement of the slider.i also process the image when have done after the slider finishes moving.but the result is not very good.i want to known how the median dialog realize which the leadtools provided.can you provide some suggest how to process is only done after the slider finishes moving.
thank you very much.
#5
Posted
:
Thursday, October 22, 2009 6:16:04 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I'm not sure that I understand the problem, what is the problem exactly? What exactly do you mean by "the result is not very good"? Do you mean that you are still facing an issue with sliding speed? Or do you mean that the display quality in the dialog is not good?
Regarding the issue of when to process the image, try to find a notification that is sent after slider finishes scrolling to process the image.
#6
Posted
:
Thursday, October 22, 2009 5:07:06 PM(UTC)
Groups: Registered
Posts: 16
hello:
the problem is sliding speed.it is very slow.
how L_DlgGetChange() it realize.
#7
Posted
:
Sunday, October 25, 2009 6:12:08 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
One way to do it is to handle the WM_HSCROLL message and only process the bitmap when scrolling finishes (scrollbar code = SB_ENDSCROLL).
Here's how to use this approach:
void CImageProcessDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
m_nSilder = m_SliderCtrl.GetPos();
m_strEdit.Format("%d",m_nSilder);
m_Edit.SetWindowText(m_strEdit);
if(SB_ENDSCROLL == nSBCode)
{
m_bitmap.Copy(m_BeforeImage.LeadBitmap);
m_bitmap.MedianFilter(m_nSilder);
m_AfterImage.LeadBitmap.Copy(m_bitmap);
m_AfterImage.SetPaint();
}
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
#8
Posted
:
Sunday, October 25, 2009 11:25:50 PM(UTC)
Groups: Registered
Posts: 16
hello:
it's working. thank you very much!
[:D]
have a nice day.
LEADTOOLS Support
Imaging
Imaging SDK Questions
how to realize my own Median Dialog like leadtools Median Dialog
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.