Menu

Creating TDPFImageView At Run Time

Steve
2014-06-05
2015-02-04
  • Steve

    Steve - 2014-06-05

    I'm attempting to create a TDPFImageView component at run time with code similar to this:

    ImgViewer1 := TDPFImageView.Create(tabItemImage1);
    ImgViewer1.Parent := tabItemImage1;
    ImgViewer1.Align := TAlignLayout.Client;
    ImgViewer1.Bitmap := fMyBitmap;

    But it's not working? I am unable to see the image (even if I set a border and colour). Is there something obvious that I'm doing wrong here?

     
  • Marian

    Marian - 2014-07-10

    Hi steve,
    I have the same issue. did you find a solution?

     
  • Jourdon

    Jourdon - 2015-01-30

    Same here in XE7, i create dynamically a TDPFJEditText and i just can't see it (but it's created !) : if i try setting focus on it i get a message like Unable to set focus on this control. I have to create it at runtime since my application run under Windows, IOS and Android... but the component has to be Native for an embedded scanner to work.

    i tried so many parameters and combinations, here is a full list :

    {$IFDEF ANDROID}
    EdtSearch := TDPFJEditText.Create(Self);
    with EdtSearch do
    begin
    OnChanged := EdtSearchChange;
    Parent := ToolBar1;
    Align := TAlignLayout.Client;
    Visible := True;
    Enabled := True;
    Position.Y := 0;
    Position.X := 0;
    Top := 0;
    Left := 0;
    TextSize := 21;
    Alpha := 1;
    touch.InteractiveGestures := [TInteractiveGesture.LongTap, TInteractiveGesture.DoubleTap];
    Margins.Left := 4;
    Margins.Top := 4;
    Margins.Right := 4;
    Margins.Bottom := 4;

    end;
    {$ELSE}

    Thanks in advance for any hint...

     
  • Jourdon

    Jourdon - 2015-02-04

    I got it working : putting it at design time all alone on a form, and instantiating the form at run time.

    But now even if i Free/DisposeOf/Hide it, it's always visible over all my forms until i close the whole application...
    No idea how to hide/destroy it or even creating it at runtime correctly ?

     

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.