Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 06/14/20 in all areas

  1. What I have: a frame with a semi-arc that represents a gauge for information like temperature. See the attached image. Each of these controls are into a frame which I create in runtime depending from what I receive from my server. The structure is: TFrame->TRectangle->TPaintBox. The issue: when I run with Windows the arcs are correctly drawn, I sent the Value so it draws fine the correct gauge. When I run with Android, using the example attached with 3 gauges, all the 3 gauges will get redraw with the same value, even I am pointing to only one. I am using a code I found a modified later, but most of it is close to the original, it will use anti-aliasing to draw the arc, the code is bellow: type TAAArcSettings = record AStart, AEnd, Opacity: single; AThickStart, AThinkEnd: integer; Color: TAlphaColor; end; procedure TframeGauge.DrawArcAA(AParams: TAAArcSettings); var path: TPathData; poly: TPolygon; begin path := TPathData.Create; path.AddArc(rect.CenterPoint, TPointF.Create(rw, rh), AParams.AStart, AParams.AEnd); path.AddArc(rect.CenterPoint(), TPointF.Create(rw - AParams.AThickStart, rh - AParams.AThinkEnd), AParams.AStart + AParams.AEnd, -AParams.AEnd); path.ClosePath(); path.FlattenToPolygon(poly); APaintBox.Canvas.Fill.DefaultColor := TAlphaColorRec.Blue; APaintBox.Canvas.Stroke.Kind := TBrushKind.Solid; APaintBox.Canvas.Fill.Color := AParams.Color; APaintBox.Canvas.FillPolygon(poly, AParams.Opacity); path.DisposeOf; end; I make some calculations to define the initial and final angle plus the percent for the value representation. To intent set a value the code below is used: ArcSetting.AEnd := AEndAngle; ArcSetting.AStart := START_ANGLE; Rectangle1.BeginUpdate; APaintBox.Canvas.BeginScene; APaintBox.Repaint; // this will trigger the PaintBoxPaint() method and there inside I can the DrawArcAAA() APaintBox.Canvas.EndScene; Rectangle1.EndUpdate; There is a procedure TframeGauge.setGaugeValue(Value: integer) which will make the code above. In the main form it detects the frame and will call this procedure, but as I say all of any gauges will be drawn with the new value. This won't happen with Windows (both 32 and 64 bit). Maybe FMX for Android it is required something else beyond I know 😞 Thanks for reading and any clue where I could search for?
  2. Yes it is, thank you. I thinking to release it all source code later. The idea behind is simple and it is a quarantine project: I was thinking to monitor some of my computer sensors using WMI queries, but quickly I realise the information about GPU is device dependent on drivers and the time I would expend to accomplish won't be wort. I found a software called Open Hardware Monitor (https://github.com/openhardwaremonitor/openhardwaremonitor) that you can keep it running in background and expands the WMI. Now I have a server that read temps and loads so I can choose what I want to monitor. My computer case has a glass so I could put an old tablet or phone there inside 😄 Here's more decent screenshot of both client and server (still a WIP).
  3. Mahdi Safsafi

    RTTI in dpr / console app dpr

    Thank you 😊 In the attached file, you'll find what I did and an interpretation to results (of course from my point of view). Let me know if you've any questions. program.dpr
  4. Mahdi Safsafi

    RTTI in dpr / console app dpr

    I did a little experimentation to explore how compiler deals with rtti/qualified_name, let me know if you're interested.
  5. dummzeuch

    GExperts 1.3.12 beta for Delphi 10.3 Rio available

    I'm happy to report that the problem with the icons in the popup menus causing empty entries seems to have been fixed in Delphi 10.4. So I have now enabled them in GExperts again.
×