* * *

Author Topic: Corrupted Glyphs  (Read 682 times)

L.Raúl

  • New member
  • *
  • Posts: 44
  • My interests: Healthcare & Computers
    • My Linkedin Profile, you can add me to stay in contact.
Corrupted Glyphs
« on: September 26, 2017, 04:15:39 am »
Hello,

this one is driving me crazy...

Can some one please explain the following issue? What I'm doing wrong?

Take a look at both pictures. One is the form designer from the IDE and the other one is from the program, compiled and running. As you can see, some
glyphs (png file format) appear completly distorted. Why??

I can't figure out what I am missing here.
regards,
Pharmacy + Biotechnology + Pharmacology + Organic Chemistry + Helthcare + Computing

If you have any interest or project related with these areas feel free to contact me!

Handoko

  • Hero Member
  • *****
  • Posts: 1644
  • My goal: build my own game engine using Lazarus
Re: Corrupted Glyphs
« Reply #1 on: September 26, 2017, 05:37:18 am »
Can you provide us some of the problematic pictures? We need to inspect it to find the answer.

L.Raúl

  • New member
  • *
  • Posts: 44
  • My interests: Healthcare & Computers
    • My Linkedin Profile, you can add me to stay in contact.
Re: Corrupted Glyphs
« Reply #2 on: September 26, 2017, 06:36:39 pm »
Here they are. No clue of what's wrong.
Pharmacy + Biotechnology + Pharmacology + Organic Chemistry + Helthcare + Computing

If you have any interest or project related with these areas feel free to contact me!

wp

  • Hero Member
  • *****
  • Posts: 3801
Re: Corrupted Glyphs
« Reply #3 on: September 26, 2017, 06:49:09 pm »
I don't see the issue on Windows (Laz trunk/fpc 3.0.2 32 bit on Win 10/64 bit). What is your OS? Which widgetset? Which Lazarus version? 32 or 64 bit? A graphics-related bug recently has been fixed for qt (https://bugs.freepascal.org/view.php?id=32465).
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

L.Raúl

  • New member
  • *
  • Posts: 44
  • My interests: Healthcare & Computers
    • My Linkedin Profile, you can add me to stay in contact.
Re: Corrupted Glyphs
« Reply #4 on: September 27, 2017, 01:00:10 am »
I am using right now Windows 10 64 bit and 64 bit FPC (CodeTyphon ide though). I'm gonna check the 32 bit environment.
Pharmacy + Biotechnology + Pharmacology + Organic Chemistry + Helthcare + Computing

If you have any interest or project related with these areas feel free to contact me!

L.Raúl

  • New member
  • *
  • Posts: 44
  • My interests: Healthcare & Computers
    • My Linkedin Profile, you can add me to stay in contact.
Re: Corrupted Glyphs
« Reply #5 on: September 27, 2017, 01:54:53 am »
Under the 32-bit IDE /64 bit Windows 10 environment the results are as follow in the images.
Glyphs appear corrupted in the form designer aswell. This is really wierd.

When designing the GUI I tend to copy&paste buttons if they have the size and dimenssions I like, and then I change the bitmap to the one intended for that button. Is there anything wrong in this procedure? Maybe the previous glyph it's not really deleted and corruprts the new one?  %)

thanks,

Pharmacy + Biotechnology + Pharmacology + Organic Chemistry + Helthcare + Computing

If you have any interest or project related with these areas feel free to contact me!

L.Raúl

  • New member
  • *
  • Posts: 44
  • My interests: Healthcare & Computers
    • My Linkedin Profile, you can add me to stay in contact.
Re: Corrupted Glyphs
« Reply #6 on: September 27, 2017, 02:02:43 am »
Here's the source code, I don't seem to progress. I'll try to redraw the problematic bitmaps. Please, where can I find the specifications for glyph files to be used  in buttons if there are any?

regards
Pharmacy + Biotechnology + Pharmacology + Organic Chemistry + Helthcare + Computing

If you have any interest or project related with these areas feel free to contact me!

Handoko

  • Hero Member
  • *****
  • Posts: 1644
  • My goal: build my own game engine using Lazarus
Re: Corrupted Glyphs
« Reply #7 on: September 27, 2017, 08:33:46 am »
Simply open the png file and re-save it using GIMP cannot solve the issue. But forcing it to PNG-24 seems to solve the problem:

GIMP main menu > File > Save for Web > PNG-24

My guess is, Lazarus has problem handling 8-bit PNG files. Where did you get those pictures? Did you draw them yourself?
« Last Edit: September 27, 2017, 08:36:55 am by Handoko »

avra

  • Hero Member
  • *****
  • Posts: 1121
    • Additional info
Re: Corrupted Glyphs
« Reply #8 on: September 27, 2017, 08:52:37 am »
There might be a problem handling transparency in PNG images:
https://www.google.rs/search?q=png+transparent+problem
ct2laz - Easily convert components and projects between Lazarus and CodeTyphon

wp

  • Hero Member
  • *****
  • Posts: 3801
Re: Corrupted Glyphs
« Reply #9 on: September 27, 2017, 10:46:08 am »
I never had problems with the transparency of png images in Lazarus. But all my glyphs were "colored". these glyphs here are monochrome. Opening them in gimp, menu "Image" > "Mode", tells me they are "grayscale". Switching this to "rgb", re-exporting to png and re-loading into the demo program shows that the problem is solved this way.

I am attaching some (not all) of your glyphs saved in rgb color space.

@Handoko: My gimp (v2.8.22) does not have a menu "Save for web". Which version are you using?
« Last Edit: September 27, 2017, 10:49:59 am by wp »
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Handoko

  • Hero Member
  • *****
  • Posts: 1644
  • My goal: build my own game engine using Lazarus
Re: Corrupted Glyphs
« Reply #10 on: September 27, 2017, 11:55:05 am »
Save for Web is very handy feature for web designers, it is a separate download as extension/plugin (for Windows). It usually installed by default on Linux.

http://registry.gimp.org/node/33

L.Raúl

  • New member
  • *
  • Posts: 44
  • My interests: Healthcare & Computers
    • My Linkedin Profile, you can add me to stay in contact.
Re: Corrupted Glyphs
« Reply #11 on: October 18, 2017, 12:15:24 am »
Thank you all for your help


regards
Pharmacy + Biotechnology + Pharmacology + Organic Chemistry + Helthcare + Computing

If you have any interest or project related with these areas feel free to contact me!

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus