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
 Problem with loading wallpaper into imageenview
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AdrianKnowles

USA
35 Posts

Posted - Sep 17 2017 :  02:18:49  Show Profile  Reply
Hi,
I've been looking for a workaround for the bug that seems to occur between cropping ROI's when coordinates are shared btwn imageenview components(see post from a couple of days ago).
I thought to try to load my images as wallpaper but for some reason they do not display when application executes either
1) When I have it set up in IDE.
2) I try to load it manually.

Am I doing something wrong?

Thanks in advance,
Adrian



unit Wallpaper;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, hyieutils, iexBitmaps, hyiedefs,
  iesettings, iexLayers, iexRulers, Vcl.StdCtrls, ieview, imageenview,
  Vcl.Imaging.pngimage, ieopensavedlg;

type
  TForm1 = class(TForm)
    ImageEnView1: TImageEnView;
    LoadButton: TButton;
    ImageEnView2: TImageEnView;
    OpenImageEnDialog1: TOpenImageEnDialog;
    procedure LoadButtonClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.LoadButtonClick(Sender: TObject);
var
  fn:string;
begin
  if OpenImageEnDialog1.Execute then
  begin
    fn := OpenImageEnDialog1.FileName;
    ImageEnView1.WallpaperStyle := iewoStretch;
    imageenview1.wallpaper.LoadFromFile(fn);
    imageenview1.Update;
  end;
end;

end.




xequte

38127 Posts

Posted - Sep 17 2017 :  20:12:47  Show Profile  Reply
Hi

By default, Layer 0 will have a size of the TImageEnView, so if you want to see the wallpaper without loading an image, either:

- Hide Layer 0: ImageEnView1.CurrentLayer.visible := False;
- Set image size (layer 0) to something smaller than the control, e.g. ImageEnView1.IEBitmap.Allocate( 1, 1 );

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