Recent

Author Topic: TImage, TSpeedButton, TBitButton image problem  (Read 17557 times)

dusanx

  • New Member
  • *
  • Posts: 17
TImage, TSpeedButton, TBitButton image problem
« on: February 10, 2009, 10:56:37 pm »
No matter what format I try everything looks great in designer but when I compile and start application there are no images. Tried png, jpg, bmp, ico and most of the other formats. What can be the reason?

I am testing this on PPC4 OSX 10.4.8 mean tower machine and using Carbon interface.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: TImage, TSpeedButton, TBitButton image problem
« Reply #1 on: February 10, 2009, 11:09:53 pm »
Good question. Are you using the 0.9.26 stable version of Lazarus?

When you open the project again in Lazarus, are the images okay still in TBitBtn, etc.?

Also, this won't affect what you're seeing, but you might as well upgrade your Tiger to the  10.4.11 version. That will probably be the last update for Tiger and you might as well have it.

Thanks.

-Phil

dusanx

  • New Member
  • *
  • Posts: 17
Re: TImage, TSpeedButton, TBitButton image problem
« Reply #2 on: February 11, 2009, 07:27:04 am »
>>Good question. Are you using the 0.9.26 stable version of Lazarus?

Yes, official stable version.

>>When you open the project again in Lazarus, are the images okay still in TBitBtn, etc.?

You are right, there is no pictures. I have this old machine suitable only for project compiling so I did not tried to change and save anything, just compile from IDE. Would command line compilation help me avoid losing images?

>>Also, this won't affect what you're seeing, but you might as well upgrade your Tiger to the  10.4.11 version. That will probably be the last update for Tiger and you might as well have it.

Just checked, I do have 10.4.11  :-[. Not very familiar with OS X versions lol.

I am wondering if this happens only here or is it common PPC (or Mac) problem? If it's only on my machine, I can kill everything and do a fresh install. Or i can load images from resources if that will help?

Thanks for your help, I have pretty urgent multi-platform contract and did not expect any problems with Mac version. Any suggestion will be appreciated.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: TImage, TSpeedButton, TBitButton image problem
« Reply #3 on: February 11, 2009, 04:06:21 pm »
When you compile, that saves the form to a .lfm file. Open the .lfm file in TextEdit (it's just a text file) and make sure there is actually something in the Picture.Data property of your control. It should look something like this:

      Picture.Data = {
        055449636F6E0000010001002020100000000000E80200001600000028000000

If this is there and a saved project doesn't display anything for the image when reopened, could you please log that as a bug report and be sure to include an example set of source files for a simple project that would allow this bug to be reproduced. It's very possible that I'm just not understanding what it is that's wrong. Maybe there's a simple workaround. But right now we're just shooting in the dark. An example would help a lot.

Thanks.

-Phil

dusanx

  • New Member
  • *
  • Posts: 17
Re: TImage, TSpeedButton, TBitButton image problem
« Reply #4 on: February 11, 2009, 07:37:43 pm »
I created small test case and got weird results:
http://xs.to/xs.php?h=xs136&d=09073&f=screenshot_of_ppc508.png

This is new project with only one timage and png image loaded. When I save project data is there, project loads with image but compiled form has no image visible (everything is on the screenshot). Of course TImage is there just has no graphics -- If I do LoadFromFile png shows correctly. Data is there after compilation and another saving, checked that too.

Weird thing is that this differs from my original project behavior: original project loads correctly (created on linux/windows) once and I can see pictures in design mode, after I save project on Mac and load it later there are no pictures. I will check what happens with .data in this project later and report here. Test project loads correctly every time, there are no compilation errors and there is no image in compiled app.

I would like to help, just don't know where to look because now I have two projects that behave differently.

I 'fixed' mu original project with several LoadFromFile commands  :-[


Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: TImage, TSpeedButton, TBitButton image problem
« Reply #5 on: February 11, 2009, 08:02:35 pm »
This might be a bug. Please file a bug report and include your test project source files.

I assume you don't have TImage.Visible set to False or anything.

Also, does it make any difference if you set AutoSize to False? I think that's the default.

Normally a component uses basically the same code in design mode as it does at runtime so it's kind of a mystery why it works in the IDE but not in your running form.

Don't know if this helps any.

Thanks.

-Phil

dusanx

  • New Member
  • *
  • Posts: 17
Re: TImage, TSpeedButton, TBitButton image problem
« Reply #6 on: February 11, 2009, 08:30:45 pm »
This might be a bug. Please file a bug report and include your test project source files.

No problem. Is there wiki or something how to file a bug report?

Quote
I assume you don't have TImage.Visible set to False or anything.

No. If I add button to this test project that calls Image1.Picture.LoadFromFile, app loads image from disk and shows component perfectly. In my other project I have few TImage and few TSpeedButton components. They are all visible but speedbutton shows only text and no image. After LoadFromFile everything works as normal.

Quote
Also, does it make any difference if you set AutoSize to False? I think that's the default.

Same problem. Not only for TImage but also for TSpeedButton and TBitBtn -- buttons don't have autosize.

Quote
Normally a component uses basically the same code in design mode as it does at runtime so it's kind of a mystery why it works in the IDE but not in your running form.

Don't know if this helps any.

Thanks.

-Phil


Thanks Phil. Helps of course, there are things that I might forgot to test like .data saving. If you point me to the right direction with bug reporting thingy I would like to help with Lazarus project.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: TImage, TSpeedButton, TBitButton image problem
« Reply #7 on: February 11, 2009, 08:58:38 pm »
Click Bugtracker on the left.

If I recall correctly, I think you need to create a new account, but you could first try your forum account just to make sure it doesn't work. I think you can create an account with the same user name as what you're using on the forum to make it easier to remember.

Once you're in Mantis, click Report Issue and fill in everything. You can attach a zipped file with your test project source files. You don't need to include the compiled executable or any .o or .ppu files, just the source files.

I'm not sure if there's a wiki topic for this, but it shouldn't be hard to figure out. Mantis is fairly straightforward and reliable. I convinced another project I'm involved with to switch to Mantis when I saw the horrible system they were using.

Thanks.

-Phil

dusanx

  • New Member
  • *
  • Posts: 17
Re: TImage, TSpeedButton, TBitButton image problem
« Reply #8 on: February 12, 2009, 03:58:07 am »
Turned out that this is known confirmed bug with one of the devs working on this problem. There is streaming error in PPC version and solution that works for me: prepare everything on linux or windows -> copy project to mac -> compile without saving project. Just adding it here for the record.

Thanks.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: TImage, TSpeedButton, TBitButton image problem
« Reply #9 on: February 12, 2009, 05:23:48 am »
Good to know. And probably some relief to you to know that you weren't just seeing things.

Thanks.

-Phil

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: TImage, TSpeedButton, TBitButton image problem
« Reply #10 on: February 16, 2009, 09:23:38 am »
Turned out that this is known confirmed bug with one of the devs working on this problem. There is streaming error in PPC version
What is the bug report number?

dusanx

  • New Member
  • *
  • Posts: 17
Re: TImage, TSpeedButton, TBitButton image problem
« Reply #11 on: February 17, 2009, 08:33:54 am »

 

TinyPortal © 2005-2018