ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Adding multiple objects at once

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
spetric Posted - Mar 03 2017 : 17:10:32
Hi,

I'm currently using standard AddNewObject method to add objects in a loop:


for (int i = 0; i < _keyPoints->Count; i++)
   {
   key = &(_keyPoints->Data[i]);
   hobj = _paint->AddNewObject();
   radius = ceil(key->scale * SiftParams.InitSigma);  // initial sigma
   _paint->ObjPenColor[hobj] = clAqua;
   _paint->ObjKind[hobj] = iekELLIPSE;
   _paint->ObjTop[hobj]  =  key->y - radius + addY;
   _paint->ObjLeft[hobj] =  key->x - radius + addX;
   _paint->ObjWidth[hobj] =  radius*2;
   _paint->ObjHeight[hobj] = radius*2;
   }

If there are 5000 objects, it can take a while for a loop to finish.
Is it possible somehow to add a bunch off objects at once?

If not, any suggestion to speed up object addition would be highly appreciated.
Objects are only visible and can not be selected, resized or moved.

Maybe to draw them on a bitmap and then add bitmap as object!?

TIA,
Siniša




3   L A T E S T    R E P L I E S    (Newest First)
spetric Posted - Mar 08 2017 : 09:36:16
Thanks Bill and Nigel.

I'll probably draw objects to bitmap, or add a warning when number of objects exceeds 1000.
xequte Posted - Mar 04 2017 : 19:56:02
Hi Sinisa

Yes, I'm afraid you are likely to see performance issues with that many objects. If the objects don't need to be interactive you should simply draw them directly to the bitmap canvas.




Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Mar 04 2017 : 12:13:24
I have not tried to add 5000 objects at one time, but I suspect you should try your idea of using a bitmap. It may take quite a while to draw using a bitmap canvas with that many "objects", so you may need to use a threaded procedure to achieve this.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development