ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ImageEn ExecuteOpenDialog Feature Request
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

989 Posts

Posted - Jul 06 2025 :  06:34:39  Show Profile  Reply
I often use a similar code to load an image file in ImageEnView:

with ImageEnView1.IO do
  LoadFromFileAuto(ExecuteOpenDialog());


Request: If the CLIPBOARD contains an image FILE (or a literal PATH to an image file), then show this image in the preview area of the ImageEn OpenDialog, along with a button to load this image file from the clipboard.

This would be a very useful feature in cases where there is no visible ImagenView control (only temporarily created) or when the user decides to select the image source (file or clipboard) at the time the OpenDialog is displayed, as it would spare the user from having to save the clipboard image only to be able to load it afterwards.

xequte

39097 Posts

Posted - Jul 08 2025 :  04:11:55  Show Profile  Reply
Hi Peter

Unfortunately the built-in open dialog is becoming less relevant as Windows advances, so we tend to recommend using the "Modern Windows" dialog option instead (as it supports all modern Windows features). However this means we cannot add functionality to it.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

PeterPanino

989 Posts

Posted - Jul 10 2025 :  07:31:43  Show Profile  Reply
There is a VCL component "Dialog Workshop" that allows (among other things) modifying standard Open/Save dialogs. I will explore possibilities to achieve the requested behavior with this component.
Go to Top of Page

xequte

39097 Posts

Posted - Jul 10 2025 :  21:51:18  Show Profile  Reply
Hi Peter

That is a very old component (pre-Windows XP) so I don't know that I would be using that.

You could try adding a paste button yourself to TOpenImageEnDialog using:

http://www.imageen.com/help/TOpenImageEnDialog.OnCreateCustomControls.html

Something like:

procedure TfrmMain.dlgOpenImageCreateCustomControls(Sender: TObject);
const
  BUTTON_TOP    = 0;
  BUTTON_LEFT   = 410;
  BUTTON_WIDTH  = 140;
  BUTTON_HEIGHT = 25;
var
  p: TWinControl;
  btn: TButton;
begin
  p := (sender as TOpenImageEnDialog).InfoPanel;
  btn := TButton.Create(p);
  btn.Parent := p;
  btn.Caption := 'Paste from Clipboard';
  // Note: Need to handle screen scaling
  btn.SetBounds( BUTTON_LEFT, BUTTON_TOP, BUTTON_WIDTH, BUTTON_HEIGHT );
  btn.OnClick := OpenDialogPasteBtnClick;
end;

procedure TfrmMain.OpenDialogPasteBtnClick(Sender: TObject);
var
  dialogHandle: HWND;
begin
  dialogHandle := GetActiveWindow;

  if ImageEnView1.Proc.CanPasteFromClipboard() = False then
  begin
    MessageDlg( 'There is no image on the clipboard', mtInformation, [ mbOK ], 0 );
    SetForegroundWindow( dialogHandle );      // Bring to front
  end
  else
  begin
    // Close the Open Dialog
    if dialogHandle <> 0 then
      EndDialog( dialogHandle, IDCANCEL );

    ImageEnView1.Proc.PasteFromClipboard()
  end;
end;


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: