|
YOu said you located 2 libraries that can "merge" 2 polygons, as i understood, i thought your problem was how you would merge more then two polygons. So actually what you want has nothing to do with the libraries because you don't want to use them but instead you want to do the task without the help of these, right? Well, if you are doing this under windows you could try creating regions from your polygons and merge them (windows can do this for you), how you get the points back from the resultiong region i don't know yet.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
yes, i want to merge the regions and just get the outer contour.
As simple as that and I have to use clipper?.(it is in borland delphi/c++)
|
|
|
|
|
I doubt Clipper is the only language you could implement this in.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
no it is in delphi/c++ and gpc is in c++.I dont a demo program to use
the libraries under vs2010..that is the problem.both use a algorithm
called vattis algorithm in computational Geometry.
in vs2010 /c++(unmanaged) i dont know how to do graphics .
|
|
|
|
|
So let me get this straight:
1. one of the libraries you could use is written in C++
2. the second one you could use is written in pure, standard C++
3. you have sources, so not lib files
4. you want to work in VC++ with VS2010, use one of these libraries in it and display graphical representations of your polygons but you don't know how to:
-use any of the libraries in VC++
-do graphics in VC++
If i am correct then i believe you should first learn some basic VC++/Windows programming before getting to the actual implementation of this polygon thing. If one of your libraries is written in standard C++, you probably whould be able to build it with VC++ too.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
yes,you got it right.I also know how to do some vc++(the old c++ not the new
one with lambda,..).I know vb.net ok and also c++.
I have asked a friend to help me in command line and probably when i show him my face next we will have a c++ program which
readpolygons,readpoygons,
perform union,
write result polygons
no graphics....so sad...
ps:i have got 1 more library, in c of the previous decades.
|
|
|
|
|
Hi All
I am facing very fracturing problem.My application some control move from original position and some control hide.i use Static,Edit Box,List Box,List Control,Picture control and Spin Control.
I use OnEraseBkgnd and OnCtlColor function for background color and control color.Code is here
HBRUSH CTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if((pWnd->GetDlgCtrlID() == IDC_CHECK_REAL) || (pWnd->GetDlgCtrlID() == IDC_STATIC_REAL))
{
hbr = CreateSolidBrush(RGB(250, 252 , 254));
pDC->SetBkColor(RGB(250,252,254));
pDC->SetTextColor(RGB(0,0,0));
pDC->SetBkMode(OPAQUE);
}
if((pWnd->GetDlgCtrlID() == IDC_EDIT_MAXPATH))
{
hbr = CreateSolidBrush(RGB(255, 255 ,255));
pDC->SetBkColor(RGB(255, 255 , 255));
pDC->SetTextColor(RGB(0,0,0));
pDC->SetBkMode(OPAQUE);
}
}
BOOL CtESTDlg::OnEraseBkgnd(CDC* pDC)
{
CRect rect;
GetClientRect(&rect);
pDC->FillSolidRect(rect,RGB(250,252,254));
return TRUE;
}
|
|
|
|
|
Hi sir.
When i type any character in the CombBox.I am sorting and displaying the results in dropdown.
But the first string which comes in DropDown is being set in ComboBox.
For Ex: If i have some strings in CComboBox : 1)"Pas",2)"Pad"
When i type P in Combo the same "P" character must be set to the ComboBox not "Pas".
Any idea will be thankful
Thanks
Raj
|
|
|
|
|
you can not directly enter values in comboBox.
You can use like this
CComboBox* test;
for (int i=0;i< test->GetCount();i++)
{
test->SetItemData(i, i);
}
|
|
|
|
|
Hello All,
General Idea:- I am developing application win32 cleint server type (It is like desktop monitoring ).
On server side I am takeing screen shot. & sending it to client side.
On server side I have function code like
--------------------------------------------
|
|
|
<pre><pre>hdc1 = GetDC(NULL);
hdc2 = CreateCompatibleDC(hdc1);
GetWindowRect(GetDesktopWindow(), &rc);
w = rc.right-rc.left;
h = rc.bottom-rc.top;
bmih.biSize = sizeof(BITMAPINFOHEADER);
bmih.biWidth = w;
bmih.biHeight = h;
bmih.biPlanes = 1;
bmih.biBitCount = 24;
bmih.biCompression = BI_RGB;
bmih.biSizeImage = ((((bmih.biWidth * bmih.biBitCount) + 31) & ~31) >> 3) * bmih.biHeight;
bi.bmiHeader = bmih;
aBmp = CreateDIBSection(hdc1, &bi ,DIB_RGB_COLORS, (void**)&dibvalues, NULL, NULL);
OldObj = SelectObject(hdc2, aBmp);
BitBlt(hdc2, 0, 0, w, h, hdc1, 0, 0, SRCCOPY);</pre>
//////////////////////////////////////////////////////////////</pre>
I have class like
<pre>class DesktopScreen{
public:
BITMAPINFOHEADER bmih ;
BITMAPINFO bi; unsigned char dibvalues[lenght]; };</pre>------------------------------------------------------------------
using above code I am filling Object of this class & sending it to other side
in binary formate (byte).
On Client side deserializing is also OK (I check all value at time of debuging )
<pre>Now at time WM_Paint:
hDC = BeginPaint(hWnd, &Ps);
i= StretchDIBits(hDC, // destination rectangle 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), // source rectangle 0, 0,desktopObj.bmih.biWidth , desktopObj.bmih.biHeight, desktopObj.dibvalues, &desktopObj.bi, DIB_RGB_COLORS, SRCCOPY);
//////////////////////////////////////////////////////////////////////////</pre>
StretchDIBits is returning 0 .
Application run properlly but image is not displying.
also if i call StretchDIBits on server side passing same info to that function.I mages is displaying.
Can you please tell me what should be the problem.
( sorry for posting code ,but I think it is necessary to get my Question to you )
Thanks ,
Ashish.
|
|
|
|
|
Hi I want to create ownerdraw combobox. But whenever I m calling the create function its giving assertion error. Can anybody tell me why its happeing.
here is code :
void CTxComboBoxCtrl::CreateCustomComboBox(CRect rect, CWnd* pWnd, UINT nID)
{
this->Create(WS_CHILD|WS_VISIBLE|WS_BORDER|WS_HSCROLL|WS_VSCROLL|CBS_HASSTRINGS |CBS_DROPDOWNLIST |CBS_OWNERDRAWVARIABLE ,rect,pWnd,nID);
}
CTxComboBoxCtrl id derived from CComboBox class
Thanks..
|
|
|
|
|
|
ys I m overriding the ownerdraw function. but its giving arrestion error on the beginging its self when I m calling create function from oninitdialog funuction of the dailog.
|
|
|
|
|
Please show us the ASSERT code.
|
|
|
|
|
In this line its giving assertion :
void CComboBox::MeasureItem(LPMEASUREITEMSTRUCT)
{ ASSERT(FALSE); }
|
|
|
|
|
This tells you exactly what's wrong - you haven't overidden MeasureItem in your derived class so MFC's telling you to go and do it rather than letting your code crash in a novel and interesting way later.
Cheers,
Ash
|
|
|
|
|
Since you've given CBS_OWNERDRAWVARIABLE as combo style, you need override MeasureItem.
|
|
|
|
|
Quick hint: When the assertion fires you usually get the option to go to the line that triggered the assertion. Use a debugger when the assertion fires, have a dig around and try and relate the state of the code where you are to the parameters you passed into the Create function.
It could be that you're trying to create a window with the same ID to one already in existence in a dialogue box (in which case you might need to subclass an existing control instead) or the style parameters don't work for this class. The trouble is we have no idea why/where this is happening as you can go straight to the code causing the problem and get an idea without much effort.
Cheers,
Ash
|
|
|
|
|
how can I write a function to swap to different sized string?
|
|
|
|
|
What do you mean exactly ? Could you provide an example describing what you are looking for ?
|
|
|
|
|
Like in main function I will read two string from user. I will store the string either in array of fixed size or in a pointer or simply say in the main() there are two strings:
char *c = "MSN"
char *d = "YAHOO"
I have to pass these two string in a function say swapstrings() and swap these two variables
|
|
|
|
|
You might feel this is being overly pedantic... trust me it's not. You don't store strings in pointers - all you store in pointers are addresses. It just so happens that the character pointers you're talking about point to the first character of the block of memory you've got the characters representing the string in.
If you understand that then it should be fairly easy to work out how to switch the pointers around and get the result you're after.
Cheers,
Ash
|
|
|
|
|
I cannot understand what is the difficulty in writing that?
can you clarify your question.
Величие не Бога может быть недооценена.
|
|
|
|
|
the issue occurs with the different sized strings
|
|
|
|
|
inline void inventTheWheel(std::string &s1, std::string &s2)
{
std::swap(s1, s2);
}
Another way is to just use the std::swap function directly.
|
|
|
|