Author |
Topic |
|
AndyColmes
USA
351 Posts |
Posted - Jul 17 2014 : 12:15:51
|
I am getting "Out of Memory" when trying to create a selection from Polygons. When I make a smaller Polygon area, the "Out of Memory" goes away. So, it has to do with the size. Is there a way to fix this?
Thanks in advance.
Andy
|
|
xequte
38598 Posts |
|
AndyColmes
USA
351 Posts |
Posted - Jul 18 2014 : 04:46:44
|
I set to create a polygon:
ImageEnVect1.MouseInteract := [miSelectPolygon];
Once the polygon is drawn, I try to make a selection out of the polygon:
hobj := ImageEnVect1.CreatePolygonsFromSelection; ImageEnVect1.DeSelect; ImageEnVect1.UnSelAllObjects; ImageEnVect1.Update;
ImageEnVect1.ObjPenColor[hobj] := clRed; ImageEnVect1.ObjPenWidth[hobj] := 2; ImageEnVect1.ObjPenStyle[hobj] := psSolid; ImageEnVect1.ObjBrushStyle [hobj] := bsClear; ImageEnVect1.ObjBrushColor [hobj] := clRed;
ImageEnVect1.ObjStyle[hobj] := xstyle; ImageEnVect1.Update;
Where xstyle is of TIEVStyle and as follows:
xstyle := xstyle + [ievsVisible]; xstyle := xstyle + [ievsSelectable]; xstyle := xstyle + [ievsMoveable]; xstyle := xstyle + [ievsSizeable];
If the polygon is not very large, then everything is fine, but when I make it larger to what I want, then the "Out of Memory" comes up.
I look forward to hearing back from you on how to fix this.
Thanks in advance.
Andy
|
|
|
xequte
38598 Posts |
Posted - Jul 23 2014 : 08:26:29
|
Hi
I'm afraid does not return an hobj, but rather the number of polygons created. You would need to use a different method to determine the hobj, e.g. IEV_PREVIOUS_INSERTED_OBJECT for the last added or iterating through the objects to find those where ObjKind[hobj] = iekPOLYLINE.
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
|
|
AndyColmes
USA
351 Posts |
Posted - Jul 23 2014 : 13:07:30
|
Hi Nigel,
So, if CreatePolygonsFromSelection creates an x number of polygons, is there a way to convert that closed polygon to a selection? I need to be able to "extract" that polygon area to a separate image.
Thanks Nigel.
Andy
|
|
|
xequte
38598 Posts |
|
AndyColmes
USA
351 Posts |
Posted - Jul 24 2014 : 16:17:52
|
Hi Nigel,
The real intention of using CreatePolygonsFromSelection is so that I can have a way to save the selection because I am using it to "draw" the selection using Objects like iekBOX, but in this case it would be a polygon. I am trying to save those Objects to a .IEV file then which is needed from a later part of the program. How would I do this?
Thanks Nigel.
|
|
|
AndyColmes
USA
351 Posts |
Posted - Jul 25 2014 : 22:09:48
|
Hi Nigel,
Reverting back to version 5.05 which was the version that the application was created eliminates the "Out of memory" for the same code. So, the latest version is the issue. |
|
|
xequte
38598 Posts |
Posted - Jul 26 2014 : 07:56:30
|
But are you still using the result of CreatePolygonsFromSelection as an hobj?
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
|
|
AndyColmes
USA
351 Posts |
Posted - Jul 28 2014 : 12:36:46
|
Yes I am. The function in version 5.05 has a return value which I think is really the number of polygons. But the function in the latest version does not have a return value. |
|
|
AndyColmes
USA
351 Posts |
Posted - Jul 28 2014 : 17:33:15
|
I want to confirm that compiling that same application with the latest 5.1.1 gives the Out of Memory issue but compiling it with 5.05 works as expected. Can you please verify and advise?
Thanks.
|
|
|
|
Topic |
|