Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-06

Recent Graphics changes...

23 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dominique Louis

Hi Marc,
After upgrading to the latest SVN it seems that Bitmap saving to streams is corrupted. I have noticed some improvements in other areas, but generally there are quite a few issues.

My main issue is that images are coming back as black and white instead of colour and the offsets are all wrong.

Please compare the 2 screenshots I have below in the hope that you can tell what is going wrong.

Incorrect - http://www.pascalgamedevelopment.com/images/Koala%20B&W.png

Correct - http://www.pascalgamedevelopment.com/images/Koala%20Colour.png

If you would prefer for me to log this as a bug, I can.

Dominique.

Reply by email

Vincent Snijders
to Dominique Louis
Dominique Louis wrote 16 lines
Hi Marc, After upgrading to the latest SVN it seems that Bitmap saving to streams is corrupted. I have noticed some improvements in other areas, but generally there are quite a few issues. My main issue is that images are coming back as black and white instead of colour and the offsets are all wrong. Please compare the 2 screenshots I have below in the hope that you can tell what is going wrong. Incorrect - http://www.pascalgamedevelopment.com/images/Koala%20B&W.png Correct - http://www.pascalgamedevelopment.com/images/Koala%20Colour.png If you would prefer for me to log this as a bug, I can.

What lazarus svn revision did you use?

Fixing are being made on a daily basis.

Vincent

Reply by email

Marc Weustink
to Dominique Louis: After upgrading to the latest SVN it seems that Bitmap saving to streams is corrupted. I…
Dominique Louis wrote
Hi Marc, After upgrading to the latest SVN it seems that Bitmap saving to streams is corrupted. I have noticed some improvements in other areas, but generally there are quite a few issues.

The corrupted stream is that this issue, or something else ?

Show quoted text 11 lines
My main issue is that images are coming back as black and white instead of colour and the offsets are all wrong. Please compare the 2 screenshots I have below in the hope that you can tell what is going wrong. Incorrect - http://www.pascalgamedevelopment.com/images/Koala%20B&W.png Correct - http://www.pascalgamedevelopment.com/images/Koala%20Colour.png If you would prefer for me to log this as a bug, I can.

No needed, there are some known issues on OSX (x86).

Marc

Reply by email

Dominique Louis
to Marc Weustink
Marc Weustink wrote
No needed, there are some known issues on OSX (x86).

Hmm, it all used to work fine, so I assume the new changes are not yet backwards compatible.

Great to hear that you are aware of it and have it under control.

Dominique.

Reply by email

Dominique Louis
to Marc Weustink: The corrupted stream is that this issue, or something else ? No needed, there are some…
Marc Weustink wrote
The corrupted stream is that this issue, or something else ?

Sorry I didn't answer this issue earlier. Yes I believe it is the streaming because the image I posted are all based on file streams being saved and compressed out to a binary file. That binary file is then read and displayed later on. The Colour photo shows when the streaming used to work, while the B&W photo is taken from a more recent build which definitely shows it broken.

Reply by email

Marc Weustink
to Dominique Louis
Dominique Louis wrote 9 lines
Marc Weustink wrote: > The corrupted stream is that this issue, or something else ? Sorry I didn't answer this issue earlier. Yes I believe it is the streaming because the image I posted are all based on file streams being saved and compressed out to a binary file. That binary file is then read and displayed later on. The Colour photo shows when the streaming used to work, while the B&W photo is taken from a more recent build which definitely shows it broken.

Can you sent me the png image itself ?

Marc

Reply by email

wile64
to Marc Weustink

Hi,

I turn quickly,

I load images like this, (size 8192x8192)

var
     BmpMap: TBitmap;
     Image1: TImage;
Begin
   BmpMap.Width: = Map.width * Tiles.Width;
   BmpMap.Height: = Map.height * Tiles.Height;
   MapImage: = BmpMap.CreateIntfImage;
   / / ... image processing
   BmpMap.LoadFromIntfImage (MapImage);
   Image1.Picture.Bitmap.Assign (BmpMap);
end;

1) Since the last change LoadFromIntfImage takes +/- 11 seconds, before 1 second.
2) The TImage is in a ScrollBox, the image disappears (1seconde) when I scroll.

Is this a problem or should be done differently now?

Thanks,

Laurent. "If debugging is the art of removing bugs, then programming must be the art of creating!" My Components: http://wiki.lazarus.freepascal.org/Wile64 French Forum : http://lazforum-fr.tuxfamily.org/index.php -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080703/5aec61a4/attachment-0001.html

Reply by email

Dominique Louis
to Marc Weustink: Can you sent me the png image itself ? Marc
Marc Weustink wrote
Can you sent me the png image itself ?

I don't know how I keep missing your replies!

Sorry about the delay.

Those PNGs are screen shots of a game in action. So they indicates how the internal bitmaps ( actual *.bmp files ) were being decoded.

But I have some good news and bad news. Recent updates have fixed the bitmap problem and they are now displayed correctly!! YEAH!!!

Ok now the Bad news... I now get the following error in an LCL Mac OS app... "Error reading GameIcon.Picture.Data: Stream is not an Icon type."

So it looks like reading Icons is now broken again, even though it was fixed previously.

At least there is progress being made.

Dominique.

Reply by email

Marc Weustink
to wile64: I load images like this, (size 8192x8192) var BmpMap: TBitmap; Image1: TImage; Begin…
wile64 wrote 25 lines
Hi, I turn quickly, I load images like this, (size 8192x8192) var BmpMap: TBitmap; Image1: TImage; Begin BmpMap.Width: = Map.width * Tiles.Width; BmpMap.Height: = Map.height * Tiles.Height; MapImage: = BmpMap.CreateIntfImage; / / ... image processing BmpMap.LoadFromIntfImage (MapImage); Image1.Picture.Bitmap.Assign (BmpMap); end; 1) Since the last change LoadFromIntfImage takes +/- 11 seconds, before 1 second. 2) The TImage is in a ScrollBox, the image disappears (1seconde) when I scroll. Is this a problem or should be done differently now?

There isn't much changed in LoadFromIntImage, but I need to lookup if the internal rawimage is shared correctly. In the worst case a pixelcopy is made, which is not necesary in this case.

one little optimalisation is setting the size like:

   BmpMap.SetSize(Map.width * Tiles.Width, Map.height * Tiles.Height);

Another optimalisation would be creating the RawImage directly and not through a bitmap.

(but all those don't change a bit on loadfromrawimage)

Marc

Reply by email

wile64
to Marc Weustink

2008/7/8 Marc Weustink :

Show quoted text 31 lines
wile64 wrote: > Hi, > > I turn quickly, > > I load images like this, (size 8192x8192) > > var > BmpMap: TBitmap; > Image1: TImage; > > Begin > BmpMap.Width: = Map.width * Tiles.Width; > BmpMap.Height: = Map.height * Tiles.Height; > MapImage: = BmpMap.CreateIntfImage; > / / ... image processing > BmpMap.LoadFromIntfImage (MapImage); > Image1.Picture.Bitmap.Assign (BmpMap); > end; > > 1) Since the last change LoadFromIntfImage takes +/- 11 seconds, before > 1 second. > 2) The TImage is in a ScrollBox, the image disappears (1seconde) when I > scroll. > > Is this a problem or should be done differently now? There isn't much changed in LoadFromIntImage, but I need to lookup if the internal rawimage is shared correctly. In the worst case a pixelcopy is made, which is not necesary in this case.

For info: I use always last SVN on XP SP2 AMD 2500+ 1Go memory On linux my other PC is very more speed and I see one small change

one little optimalisation is setting the size like: BmpMap.SetSize(Map.width * Tiles.Width, Map.height * Tiles.Height);

Thanks for this,

Another optimalisation would be creating the RawImage directly and not through a bitmap.
Impossible, if the image is too big there is a mistake ( Failed to create
handles )
  MapImage:= TLazIntfImage.Create(Map.width * Tiles.Width, Map.height *
Tiles.Height);
Laurent. "If debugging is the art of removing bugs, then programming must be the art of creating!" My Components: http://wiki.lazarus.freepascal.org/Wile64 French Forum : http://lazforum-fr.tuxfamily.org/index.php -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080708/212a9be9/attachment.html

Reply by email

Marc Weustink
to wile64
wile64 wrote 41 lines
2008/7/8 Marc Weustink < <mailto:>>: wile64 wrote: > Hi, > > I turn quickly, > > I load images like this, (size 8192x8192) > > var > BmpMap: TBitmap; > Image1: TImage; > > Begin > BmpMap.Width: = Map.width * Tiles.Width; > BmpMap.Height: = Map.height * Tiles.Height; > MapImage: = BmpMap.CreateIntfImage; > / / ... image processing > BmpMap.LoadFromIntfImage (MapImage); > Image1.Picture.Bitmap.Assign (BmpMap); > end; > > 1) Since the last change LoadFromIntfImage takes +/- 11 seconds, before > 1 second. > 2) The TImage is in a ScrollBox, the image disappears (1seconde) when I > scroll. > > Is this a problem or should be done differently now? There isn't much changed in LoadFromIntImage, but I need to lookup if the internal rawimage is shared correctly. In the worst case a pixelcopy is made, which is not necesary in this case. For info: I use always last SVN on XP SP2 AMD 2500+ 1Go memory On linux my other PC is very more speed and I see one small change

OK, implementation form LoadFromIntfImage explains.

   IntfImage.CreateBitmaps(ImgHandle, ImgMaskHandle);
   SetHandles(ImgHandle, ImgMaskHandle);

the rasterimage is loaded through the handles. It should be changed to get loaded by rawimage (infimage.releaserawimage)
the rawimage is internally needed anyway and this way the handle creation is postponed. THis might avoid some datacopies.

IIRC CreateBitmaps/SetHandles shouldn't be affected by my recent changes.

Show quoted text 15 lines
one little optimalisation is setting the size like: BmpMap.SetSize(Map.width * Tiles.Width, Map.height * Tiles.Height); Thanks for this, Another optimalisation would be creating the RawImage directly and not through a bitmap. Impossible, if the image is too big there is a mistake ( Failed to create handles )

A bitmap has to create the handles anyway, so if it fails for a TLazIntfImage it would for tbitmap too.

MapImage:= TLazIntfImage.Create(Map.width * Tiles.Width, Map.height * Tiles.Height);

Thats what I meant.

Marc

Reply by email

Dominique Louis
to Marc Weustink: Can you sent me the png image itself ? Marc
Marc Weustink wrote 13 lines
Dominique Louis wrote: > Marc Weustink wrote: >> The corrupted stream is that this issue, or something else ? > Sorry I didn't answer this issue earlier. Yes I believe it is the > streaming because the image I posted are all based on file streams being > saved and compressed out to a binary file. That binary file is then read > and displayed later on. The Colour photo shows when the streaming used > to work, while the B&W photo is taken from a more recent build which > definitely shows it broken. Can you sent me the png image itself ? Marc

I've logged the new TIcon problem under
http://bugs.freepascal.org/view.php?id=11650

Dominique.

Reply by email

wile64
to Marc Weustink: OK, implementation form LoadFromIntfImage explains. IntfImage.CreateBitmaps(ImgHandle,…
Show quoted text 28 lines
> one little optimalisation is setting the size like: > > BmpMap.SetSize(Map.width * Tiles.Width, Map.height * Tiles.Height); > > > Thanks for this, > > > > Another optimalisation would be creating the RawImage directly and not > through a bitmap. > > > Impossible, if the image is too big there is a mistake ( Failed to > create handles ) A bitmap has to create the handles anyway, so if it fails for a TLazIntfImage it would for tbitmap too. > MapImage:= TLazIntfImage.Create(Map.width * Tiles.Width, Map.height * > Tiles.Height); Thats what I meant.

I changed strategy and I don't load whole picture, I charge what is seen and with DoubleBuffered is great ;)

I have found a solution for the handles probleme, like this :
  PreviewImage:= TLazIntfImage.Create(0, 0);
  PreviewImage.DataDescription:=GetDescriptionFromDevice(0, 0, 0);
  PreviewImage.SetSize(PreviewWidth*32, PreviewHeight*32);
This dont work:
 PreviewImage:= TLazIntfImage.Create(PreviewWidth*32, PreviewHeight*32);

I do not know if is good, but it works :-)

PS: My program uses lots of memory, around 20 mb !

Thanks Marc,

Laurent. "If debugging is the art of removing bugs, then programming must be the art of creating!" My Components: http://wiki.lazarus.freepascal.org/Wile64 French Forum : http://lazforum-fr.tuxfamily.org/index.php -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080809/c6308871/attachment.html

Reply by email

Marc Weustink
to wile64: I changed strategy and I don't load whole picture, I charge what is seen and with…
wile64 wrote 10 lines
I changed strategy and I don't load whole picture, I charge what is seen and with DoubleBuffered is great ;) I have found a solution for the handles probleme, like this : PreviewImage:= TLazIntfImage.Create(0, 0); PreviewImage.DataDescription:=GetDescriptionFromDevice(0, 0, 0); PreviewImage.SetSize(PreviewWidth*32, PreviewHeight*32); This dont work: PreviewImage:= TLazIntfImage.Create(PreviewWidth*32, PreviewHeight*32);

Yes, this way you don't have a device description.

I do not know if is good, but it works :-)
you can combine
    PreviewImage.DataDescription:=GetDescriptionFromDevice(0, 0, 0);
    PreviewImage.SetSize(PreviewWidth*32, PreviewHeight*32);
to
    PreviewImage.DataDescription:=GetDescriptionFromDevice(
      0, PreviewWidth*32, PreviewHeight*32);

btw, why the *32 ?

Marc

Reply by email

Dominique Louis
to Marc Weustink
Marc Weustink wrote
Before .26 gets released. I'm working on it, but have a lot of dificulties with masks

Thanks for the update Marc. I have one app that won't start due to this issue, so I am keen to find out how it is going.

The update is greatly appreciated.

Dominique.

Reply by email

wile64
to Marc Weustink: Yes, this way you don't have a device description. you can combine…

2008/8/10 Marc Weustink

Show quoted text 24 lines
wile64 wrote: > I changed strategy and I don't load whole picture, I charge what is seen > and with DoubleBuffered is great ;) > > I have found a solution for the handles probleme, like this : > PreviewImage:= TLazIntfImage.Create(0, 0); > PreviewImage.DataDescription:=GetDescriptionFromDevice(0, 0, 0); > PreviewImage.SetSize(PreviewWidth*32, PreviewHeight*32); > > This dont work: > PreviewImage:= TLazIntfImage.Create(PreviewWidth*32, PreviewHeight*32); Yes, this way you don't have a device description. > I do not know if is good, but it works :-) you can combine PreviewImage.DataDescription:=GetDescriptionFromDevice(0, 0, 0); PreviewImage.SetSize(PreviewWidth*32, PreviewHeight*32); to PreviewImage.DataDescription:=GetDescriptionFromDevice( 0, PreviewWidth*32, PreviewHeight*32);

Thanks for this.

btw, why the *32 ?

Juste for test (width and height of tiles), I change this later...

regards

Laurent. "If debugging is the art of removing bugs, then programming must be the art of creating!" My Components: http://wiki.lazarus.freepascal.org/Wile64 French Forum : http://lazforum-fr.tuxfamily.org/index.php -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080810/259e658a/attachment.html

Reply by email

Marc Weustink
to Dominique Louis: Thanks for the update Marc. I have one app that won't start due to this issue, so I am…
Dominique Louis wrote 9 lines
Marc Weustink wrote: > Before .26 gets released. > I'm working on it, but have a lot of dificulties with masks Thanks for the update Marc. I have one app that won't start due to this issue, so I am keen to find out how it is going. The update is greatly appreciated.

Should be fixed in r16020

It took a while to realize that there is an error in the gtk interface and not the LCL (where I was looking).

Marc

Reply by email

EarMaster - Bent Olsen
to Marc Weustink

Hi,

We have a TMainMenu with a menu item called "Help", which of course holds the help menu items - all normal and works fine - but a subsequent call to AHRegisterHelpBook on Mac OS X results in an extra Help menu given by the OS.

Anybody have a solution for that? Either how to get some sort of handle to the new help menu, and move our menu items to this new menu item, or make the new menu item invisible.

Is this a known problem, and maybe fixed in new releases? I'm using (2.2.0) revision 15279 on i386-darwin-carbon, but this also happens on powerpc-darwin-carbon.

Thanks,
Normann

Reply by email

Tom Gregorovic
to EarMaster - Bent Olsen
EarMaster - Bent Olsen wrote 15 lines
Hi, We have a TMainMenu with a menu item called "Help", which of course holds the help menu items - all normal and works fine - but a subsequent call to AHRegisterHelpBook on Mac OS X results in an extra Help menu given by the OS. Anybody have a solution for that? Either how to get some sort of handle to the new help menu, and move our menu items to this new menu item, or make the new menu item invisible. Is this a known problem, and maybe fixed in new releases? I'm using (2.2.0) revision 15279 on i386-darwin-carbon, but this also happens on powerpc-darwin-carbon.

Hi,
can you create a bug report with simple test app?
I'm afraid I get time to fix it after new release.

Tom Gregorovic

Reply by email