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
 ImageenDBView question
 New Topic  Reply to Topic
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

xequte

38803 Posts

Posted - May 24 2021 :  18:44:42  Show Profile  Reply
Sorry, I'm a bit behind on things after taking a few days off last week. I'll get onto this over the next few days.

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

pierrotsc

USA
497 Posts

Posted - May 24 2021 :  18:50:25  Show Profile  Reply
Sweet. thank you
Best
Go to Top of Page

xequte

38803 Posts

Posted - May 24 2021 :  19:39:43  Show Profile  Reply
Hi

I added Wallpaper to this project at design time. It shows at design and runtime. Can you give me more information to reproduce?



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

pierrotsc

USA
497 Posts

Posted - May 24 2021 :  19:43:05  Show Profile  Reply
Look on the right of the soft shadow checkbox. i added an imageenview that should show a chain inside in design time. but as you can see from the picture above, it is blank. the wallpaper is gone.

The imageenview is very small. it is added to your demo
Go to Top of Page

xequte

38803 Posts

Posted - May 24 2021 :  20:20:47  Show Profile  Reply
Hi

Wallpaper is a TPicture which means it needs VCL support for the image format. Otherwise it is lost when recompiling the form if the appropriate unit has not been added to the form (which is what happens when I view your form at design or runtime)

For JPEG, you would need to add Vcl.Imaging.jpeg. What type of image file did you use the wallpaper?

You are better to use ImageEn to load and assign the wallpaper at runtime:

    // Wallpaper is a TPicture (which does not always support JPEG) so load into a TIEBitmap, and then assign the bitmap
    bmp := TIEBitmap.Create( extractfilepath(paramstr(0)) + 'Wallpaper.jpg');
    ImageEnMView1.Wallpaper.Assign( bmp.VclBitmap );
    bmp.free;


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

pierrotsc

USA
497 Posts

Posted - May 24 2021 :  20:27:02  Show Profile  Reply
Yes. It is a jpeg. This is the same behavior I am getting with the database images. I will add the back.imaging.jpeg to see. The wallpaper was just another way to show the behavior I was experiencing. I will let you know tomorrow when I try. Thanks
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - May 24 2021 :  21:06:27  Show Profile  Reply
Nigel, does not work. The image still disappears. this is the same behavior i get with the iamgeendbview. The image loads in design time but disappears in run time.
That used to work tough.
Go to Top of Page

xequte

38803 Posts

Posted - May 24 2021 :  23:52:20  Show Profile  Reply
Try doing it with a BMP file rather than a JPEG, so we can narrow it down to VCL JPEG support.

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

pierrotsc

USA
497 Posts

Posted - May 25 2021 :  07:15:58  Show Profile  Reply
I think I did and same behavior but I will try again in case.
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - May 25 2021 :  14:02:25  Show Profile  Reply
Nigel, loading jpeg, png or bmp wallpaper shows up in design time but disappear in runtime.
I bet if we can solve that, it will fix my database issue at the same time. same behavior
Best
Pierre
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - May 25 2021 :  18:49:26  Show Profile  Reply
Nigel, i modified the checkbox that load the wallpaper to reflect my imageenview.
procedure TForm1.CheckBox4Click(Sender: TObject);
var
  bmp: TIEBitmap;
begin
  if CheckBox4.Checked then
  begin
    // Wallpaper is a TPicture (which does not always support JPEG) so load into a TIEBitmap, and then assign the bitmap
    bmp := TIEBitmap.Create( extractfilepath(paramstr(0)) + 'wallpaper.jpg');
    imgvwChain.WallPaper.Assign( bmp.VclBitmap );
    bmp.free;
  end
  else
    imgvwChain.WallPaper := nil;
  imgvwChain.Update;
end;


When you click the checkbox, nothing is happening. So something has changed sometimes.

Let me know what you find out.
Best
Go to Top of Page

xequte

38803 Posts

Posted - May 27 2021 :  18:29:28  Show Profile  Reply
Hi

Please try this version of the code:

procedure TMainForm.CheckBox4Click(Sender: TObject);
var
  bmp1, bmp2: TIEBitmap;
begin
  if CheckBox4.Checked then
  begin
    // Wallpaper is a TPicture (which does not always support JPEG) so load into a TIEBitmap, and then assign the bitmap
    if FileExists( extractfilepath(paramstr(0)) + 'wallpaper.jpg' ) = False then
      raise Exception.create( 'File not found' );

    bmp1 := TIEBitmap.Create( extractfilepath(paramstr(0)) + 'wallpaper.jpg');

    if ( bmp1.Width < 20 ) or ( bmp1.Height < 20 ) then
      raise Exception.create( 'Invalid image' );

    if ( bmp1.VclBitmap.Width < 20 ) or ( bmp1.VclBitmap.Height < 20 ) then
      raise Exception.create( 'Invalid bitmap' );

    ImageEnView1.WallPaper.Assign( bmp1.VclBitmap );

    if ImageEnView1.WallPaper = nil then
      raise Exception.create( 'No wallpaper' );


    bmp2 := TIEBitmap.Create();
    bmp2.Assign( ImageEnView1.WallPaper.Bitmap );
    bmp2.write( extractfilepath(paramstr(0)) + 'CHECK_THIS_IMAGE.jpg' );

    bmp1.free;
    bmp2.free;
  end
  else
    ImageEnView1.WallPaper := nil;
  ImageEnView1.Update;
end;


If that fails, then I suspect is seriously broken with TPicture handling in your project. An incompatible unit perhaps?

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

pierrotsc

USA
497 Posts

Posted - May 27 2021 :  18:30:56  Show Profile  Reply
thanks, let me try...
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - May 27 2021 :  18:49:13  Show Profile  Reply
Ok, now this is weird. your code works when i use imageenview1 but when i replace it with imgvwChain that i have included, it does not. oh well. i am using the demo so no other unit is used.
Go to Top of Page

xequte

38803 Posts

Posted - May 27 2021 :  20:07:11  Show Profile  Reply
Hi

The default state of a TImageEnView is a white bitmap the size of the window, so you won't see the wallpaper in imgvwChain unless you call imgvwChain.Blank;

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

pierrotsc

USA
497 Posts

Posted - May 28 2021 :  10:51:42  Show Profile  Reply
Nigel, i modified the demo with your source code. clicking the checkbox should update both imageenview1 and the imgchain.
As you can see it works with imageenview1 by turning the wallpaper on and off the but imgchain does not. it displays the wallpaper but never turn off.

I did call the imgchain.blank.
If you got 2 mn, just run the demo and maybe you can find out what is going on.
Best

attach/pierrotsc/2021528105124_Thumbnails2.zip
71.08 KB
Go to Top of Page

xequte

38803 Posts

Posted - May 31 2021 :  19:27:43  Show Profile  Reply
To remove the wallpaper use:

imgvwChain.Wallpaper := nil;

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