Notice

The forum is in read only mode.

  • Page:
  • 1
  • 2

TOPIC: TWebBrowser overlapping between other controls

TWebBrowser overlapping between other controls 7 years 3 months ago #1816

Hi Francisco,

Regarding Problem 2, try this:
1. Set up an action for sharing the image and assign it to your TButton (or TSpeedButton). To do this, place TActionList onto your form, and then select TButton>Action>New Standard Action>Media Library>TShowShareSheetAction in the Object Inspector. Then set up this OnBeforeExecute event (you can access it from the Events tab by expanding the Actions menu):

void __fastcall TfrmShareSheet::ShowShareSheetAction1BeforeExecute(TObject *Sender)
{
// show the share sheet
ShowShareSheetAction1->Bitmap->Assign(imgCameraPicture->Bitmap);
}

2. Set up an on-click event that executes the ShareSheet action that you previously defined, such as:

void __fastcall TfrmShareSheet::Button1Click(TObject *Sender)
{
imgCameraPicture->ExecuteAction(ShowShareSheetAction1);
}


Regards,
Sarina
The following user(s) said Thank You: Francisco

TWebBrowser overlapping between other controls 7 years 3 months ago #1818

Hi Francisco,

The TCustomWebBrowser component has a function called CaptureBitmap which returns a static image of what is currently shown in the web browser component. You can place a TImage component in the same place (with the same alignment) as the web browser. This will help address your z-order issues on Android.

Example Application:

TToolbar with a parented TLabel and TSpeedButton; Toolbar is aligned to the top
TWebBrowser is aligned to the client
TImage is aligned to the client with no image assigned
TListBox with several items in it (i.e to create an overflow menu), set to Visible = False by default;

Set up an on-click event for the toolbar button.

Object Pascal:

procedure TForm28.SpeedButton1Click(Sender: TObject);
begin
Image1.Bitmap := WebBrowser1.CaptureBitmap;
Image1.Visible := True;
WebBrowser1.Visible := False;
ListBox1.Visible := True;
end;


C++:

void __fastcall TForm29::SpeedButton1Click(TObject *Sender)
{
Image1->Bitmap = WebBrowser1->CaptureBitmap();
Image1->Visible = True;
WebBrowser1->Visible = False;
ListBox1->Visible = True;
}


Instead of using an overflow menu (by using TListBox), you could also use the TMultiView component.

Regards,
Sarina
The following user(s) said Thank You: Francisco

TWebBrowser overlapping between other controls 7 years 3 months ago #1820

You made me think a lit bit, but I got it.
Thanks a lot! Both problems are solved!

Next time I'll try TMultiview

Cheers!!!!!!!!!!!

TWebBrowser overlapping between other controls 7 years 3 months ago #1835

Glad to hear it is working for you.

Regards,
Sarina
  • Page:
  • 1
  • 2
Moderators: April Anne