Menu

Performance of rendering (xe5)

2013-10-02
2013-10-12
  • Michal Neveknu

    Michal Neveknu - 2013-10-02

    Is this correct way how to dynamically show many controls (labels in rectangles) ? Because it takes about 26s which seems slow to me.

    This is my code:
    ...
    DPFUIScrollView1.beginupdate;
    for i := 0 to 180 do
    begin
    for j := 0 to 16 do
    begin
    view := TDPFUIView.create(nil);
    view.Width := w;
    view.Height:=h;
    view.Position.X := jw;
    view.Position.Y := i
    h;
    DPFUIScrollView1.AddControl(view);

      lbl := TDPFLabel.Create(nil);
      lbl.TextColor := TAlphaColorRec.Black;
      lbl.Text := i.ToString + '('+j.ToString+')';
      view.AddObject(lbl);
      lbl.Loaded;
    end;
    

    end;
    DPFUIScrollView1.endupdate;

    Even when I use only 80x20 I'm waiting 9s.
    Or is this normal time in pure obj-c?

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2013-10-12

    Hi Michal

    Creating over 1000 control not a better way, but i improved adding controls into ScrollView
    You can calculate controls size and ScrollView contentsize and call view.AddControl(lbl, false); with false parameter. after calling AddControl dont call lbl.Loaded;

    regards

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.