Recent

Author Topic: Timage in V2.2  (Read 1324 times)

Sage

  • New Member
  • *
  • Posts: 13
Timage in V2.2
« on: April 26, 2022, 04:39:25 am »
I have just upgraded Lazarus to V2.2 and I notice that TImage is not working properly. Is anyone else having issues with TImage not showing any pictures in 2.2?

I originally noticed it in project created in an earlier version so I tried creating a new project to test. I place a TImage on the form and change the picture to some image. When I run the application nothing shows.

dsiders

  • Hero Member
  • *****
  • Posts: 1079
Re: Timage in V2.2
« Reply #1 on: April 26, 2022, 05:26:20 am »
I have just upgraded Lazarus to V2.2 and I notice that TImage is not working properly. Is anyone else having issues with TImage not showing any pictures in 2.2?

I originally noticed it in project created in an earlier version so I tried creating a new project to test. I place a TImage on the form and change the picture to some image. When I run the application nothing shows.

I just tested 2.2.0 and 2.3.0 here. Using PNG, JPG, BMP, ICO, and GIF. I had no issues loading a TImage at design-time or at run-time. I would suspect something in your code or the image file.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

Sage

  • New Member
  • *
  • Posts: 13
Re: Timage in V2.2
« Reply #2 on: April 26, 2022, 05:28:53 am »
Well, that leaves me a bit confused then!
I can't see how it would be in my code when I don't have any code in the case of a blank test project!

Another piece of information that might help to narrow it down. When I open a project that was created in an earlier version of Lazarus that has Timages. All Timages are not displaying the images anymore in the editor (This is how I noticed the issue).

dsiders

  • Hero Member
  • *****
  • Posts: 1079
Re: Timage in V2.2
« Reply #3 on: April 26, 2022, 05:59:20 am »
Well, that leaves me a bit confused then!
I can't see how it would be in my code when I don't have any code in the case of a blank test project!

Another piece of information that might help to narrow it down. When I open a project that was created in an earlier version of Lazarus that has Timages. All Timages are not displaying the images anymore in the editor (This is how I noticed the issue).

What version of Lazarus did you upgrade from?
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

Sage

  • New Member
  • *
  • Posts: 13
Re: Timage in V2.2
« Reply #4 on: April 26, 2022, 06:05:04 am »
Well, that leaves me a bit confused then!
I can't see how it would be in my code when I don't have any code in the case of a blank test project!

Another piece of information that might help to narrow it down. When I open a project that was created in an earlier version of Lazarus that has Timages. All Timages are not displaying the images anymore in the editor (This is how I noticed the issue).

What version of Lazarus did you upgrade from?

2.06

Handoko

  • Hero Member
  • *****
  • Posts: 5151
  • My goal: build my own game engine using Lazarus
Re: Timage in V2.2
« Reply #5 on: April 26, 2022, 06:06:40 am »
Maybe you can test the demos that already written by someone else. These demos use TImage:
- Get pixel color of an image
- Center, resize image on the screen
- Change background color of an image
- GradientFill Rectangle
- Rock, Paper, Scissors
- Bullet and asteroid collision detection
- Selection Demo
- Sprite picking and moving
- bitmap.scanline

And this is the link:
https://wiki.freepascal.org/Portal:HowTo_Demos#Graphics

I've just tested them on Lazarus 2.2.0 FPC 3.2.2 Linux GTK2, all of them show no issue with TImage. You should download those demos and try them, if you still have issue with TImage, maybe you need to reinstall your Lazarus.

Sage

  • New Member
  • *
  • Posts: 13
Re: Timage in V2.2
« Reply #6 on: April 26, 2022, 06:09:39 am »
Maybe you can test the demos that already written by someone else. These demos use TImage:
- Get pixel color of an image
- Center, resize image on the screen
- Change background color of an image
- GradientFill Rectangle
- Rock, Paper, Scissors
- Bullet and asteroid collision detection
- Selection Demo
- Sprite picking and moving
- bitmap.scanline

And this is the link:
https://wiki.freepascal.org/Portal:HowTo_Demos#Graphics

I've just tested them on Lazarus 2.2.0 FPC 3.2.2 Linux GTK2, all of them show no issue with TImage. You should download those demos and try them, if you still have issue with TImage, maybe you need to reinstall your Lazarus.

OK, there must be something wrong with my Lazarus Installation!
I just installed Lazarus 2.2 on another computer with no issue for TImage.
I give re-installation a try.

Sage

  • New Member
  • *
  • Posts: 13
Re: Timage in V2.2
« Reply #7 on: April 26, 2022, 06:12:50 am »
OK, I have just re-installed Lazarus 2.2 but the same issue exists. Does anyone have any suggestions as to what might cause this?

Handoko

  • Hero Member
  • *****
  • Posts: 5151
  • My goal: build my own game engine using Lazarus
Re: Timage in V2.2
« Reply #8 on: April 26, 2022, 06:20:07 am »
What OS do you use? Have you reboot your PC after the installation? Virus and antivirus can be troublesome. Make sure your computer is virus free. Try disable the antivirus and Windows Defender.

If you want, you can provide the binary and the sample images and email them me. I think if the binary can be run properly on other system, that could be the issue of your OS, you may need to reinstall it.
« Last Edit: April 26, 2022, 06:24:44 am by Handoko »

Sage

  • New Member
  • *
  • Posts: 13
Re: Timage in V2.2
« Reply #9 on: April 26, 2022, 06:39:40 am »
What OS do you use? Have you reboot your PC after the installation? Virus and antivirus can be troublesome. Make sure your computer is virus free. Try disable the antivirus and Windows Defender.

If you want, you can provide the binary and the sample images and email them me. I think if the binary can be run properly on other system, that could be the issue of your OS, you may need to reinstall it.

So I'm using Windows 10 and I have tried re-starting my PC. I can't disable antivirus as it's managed at an admin level by our IT provider.

I have just installed a separate installation of Lazarus 2.2 but this still doesn't fix the problem. Actually very strange, I would have though that a fresh install of Lazarus would have fixed the issue!

Sage

  • New Member
  • *
  • Posts: 13
Re: Timage in V2.2
« Reply #10 on: April 26, 2022, 06:48:23 am »
Further to this, I have just re-installed Lazarus 2.06 as a separate installation. Timage works fine when running the 2.06 version of Lazarus.

If I create a project in 2.06 with a Timage on a form. I then set the picture to some image. I run the app and all works correctly.
Then I open this same project in Lazarus 2.2 and straight away I can see that the Timage is not showing the image that I loaded up in 2.06 in the editor. When I run the application without making any changes to the project in 2.2 then the image will show visually when I run the application. But once I try to set the picture from within 2.2 editor than it will not show when I run the application anymore.

Any idea's

« Last Edit: April 26, 2022, 06:57:10 am by Sage »

Sage

  • New Member
  • *
  • Posts: 13
Re: Timage in V2.2
« Reply #11 on: April 26, 2022, 07:13:24 am »
Further to this. I have done some comparison between the unit form files to see what the difference is. When I set the same image in both Lazarus versions I get different raw data for the Picture.Data in the unit1.lfm file.

I have attached both versions of the unit1.lfm files along with the image that I'm using. Is there a setting somewhere which would cause this to happen?

Handoko

  • Hero Member
  • *****
  • Posts: 5151
  • My goal: build my own game engine using Lazarus
Re: Timage in V2.2
« Reply #12 on: April 26, 2022, 07:48:09 am »
Please provide the compile-able source code. I am human, I can read the lfm files but I cannot not understand the binary data of the image you provided.

May I ask, have you tried the demos I mentioned earlier?

BlueIcaro

  • Hero Member
  • *****
  • Posts: 792
    • Blog personal
Re: Timage in V2.2
« Reply #13 on: April 26, 2022, 09:30:45 am »
Hi, some people reports (in this forum, section spanish language), problems with microsoft antivirus in W10.
Some people have to add lazarus to antirius exceptions list.
May be is your problem.
/BlueIcaro

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: Timage in V2.2
« Reply #14 on: April 26, 2022, 10:28:50 am »
I have just installed a separate installation of Lazarus 2.2 but this still doesn't fix the problem.
"separate installation" - is this a "secondary installation" as named by the installer? Did you create a new directory for your user settings, or did you re-use the existing one?

Find out your Lazarus primary configuration path: Open "View" > "IDE Internals" > "About IDE". Get the config path in the entry "Primary configuration directory". Close Lazarus. Rename that directory so that you can return to your old settings later if you need to. Restart Lazarus - the IDE resets all your settings and writes a new config directory (note that you will have to reinstall any third-party components afterwards!). Rebuild the IDE: "Tools" > "Configure Build Lazarus" > in the "Clean up" box check "Clean all" and "Switch after building to automatically" > "Build". After a while, when the IDE restarts you have a "clean" IDE, like after a fresh installation (except for changes that you applied to the IDE/LCL source files - but you should not do this unless you know what you are doing). Now the issue should be gone.

 

TinyPortal © 2005-2018