Jump to content

DezsoSajer

Members
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by DezsoSajer

  1. Hi, I am creating an indicator of a machine, in the style of a PFD (Primary Flight Display) using the TImage32 library. I finished the work, and I need 2 of these indicators, so I added the second one to my form (I am using a panel to draw the image). Strangly, the second one is not showing the texts. I would like to ask some pointers where I should check the source of the problem. I swapped the order of creation, and the problem swapped, too. So the first created works, but not 2nd. Thank you
  2. DezsoSajer

    Only one TImage32Panel showing texts

    Hi angusj, Thanks very much for the solution
  3. DezsoSajer

    Only one TImage32Panel showing texts

    Hi, Thanks very much for the project. I have tested, and it worked on mine PC, too. However, when I modified it to the same way I have in my project (moved it to a unit and created a class), the same thing happened. Main unit: unit main; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls,Unit1; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private public { Public declarations } end; var Form1: TForm1; Image32Panel1: testclass; Image32Panel2: testclass; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin Image32Panel1:=testclass.Create(Self,0); Image32Panel2:=testclass.Create(Self,ClientWidth div 2); end; procedure TForm1.FormDestroy(Sender: TObject); begin Image32Panel1.Free; Image32Panel2.Free; end; end. Class unit unit Unit1; interface uses System.Classes,Img32.Panels,Img32, Img32.Vector, Img32.Draw, Img32.Text,VCL.Controls; type testclass=class private FImagePanel:TImage32Panel; fc: TFontCache; public constructor Create(AOwner:TComponent;LeftPos:integer); destructor Destroy; end; implementation { testclass } constructor testclass.Create(AOwner:TComponent;LeftPos:integer); begin fc := TFontCache.Create(FontManager.Load('Arial'), dpiAware(20)); FImagePanel:=TImage32Panel.Create(AOwner); FImagePanel.Parent:=AOwner As TWinControl; with FImagePanel do begin Left:=LeftPos; Width := FImagePanel.Parent.ClientWidth div 2; image.SetSize(InnerClientRect.Width,InnerClientRect.Height); DrawLine(image, Rectangle(0,0,image.Width, image.Height), 10, clRed32, esPolygon); Img32.Text.DrawText(Image, Image.Bounds, 'This is TImagePanel Panel1', taCenter, tvaMiddle, fc); end; end; destructor testclass.Destroy; begin FImagePanel.Free; fc.Free; end; end. img32_test.zip
×