Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Ich kann nicht gelesen icon zeichnen. (https://www.delphipraxis.net/37531-ich-kann-nicht-gelesen-icon-zeichnen.html)

mihey 6. Jan 2005 22:49


Ich kann nicht gelesen icon zeichnen.
 
Ich lese ICO aus der Datei manuell in TBitmap. Ich schaffe ihn mit Hilfe CreateDIBSection (masse ich mich TBitmap. Handle) an. Ich verwende die Palette. Aber die Darstellung schwarz.

Da den vollen Kode. Versuchen Sie, Test2.ico zu öffnen. Übrigens arbeitet ausgezeichnet mit 32-bit icons.

http://www.hot.ee/mvps18/IconLoad.zip

Was zu machen?

flomei 6. Jan 2005 22:54

Re: Ich kann nicht gelesen icon zeichnen.
 
Hi,
you seem to have some problems with german language. It´s no problem to write in English, most of the developers here can speak and write English, too.

Greetings,
Florian

mihey 7. Jan 2005 12:20

Re: Ich kann nicht gelesen icon zeichnen.
 
Thank you, I really used an online translator.

I'm trying to write a class that would read and save icons because Delphi's TIcon doesn't work with 32-bit icons and in all doesn't suit me.

I create a HBITMAP using CreateDIBSection so I have a pointer to bitmap data and then I read the bits from the file into the bitmap. To create TBitmap, I assign HBITMAP to TBitmap.Handle. The code works fine with 32-bit icons that have no palette. But then I created an icon with Borland's Image Editor. The icon is 4-bit and has a palette (should have at least). And here come all the problems. When I assign a palette to TBitmap and run the program under Delphi, the system crashes. When I run the program simply under Windows, the bitmap is displayed black or in incorrect colors (depending on iUsage parameters of CreateDIBSection) and even the mask doesn't work correctly also it seem to be read properly (the image of mask is displayed properly).

The thing is I've been trying to solve this problem for a long time and still can't.

The source code is here (20 Kb). I use Delphi 5.

http://www.hot.ee/mvps18/IconLoad.zip

Try to load Test2.ico and see how the icon is displayed.

Could you help me to solve the problem???

Christian Seehase 7. Jan 2005 12:30

Re: Ich kann nicht gelesen icon zeichnen.
 
Hi mihey,

welcome to Delphi-PRAXiS.

Have you tried to use Graphics32 (TBitmap32) Library (www.g32.org) to solve your problem?

Zitat:

Zitat von mihey
I really used an online translator.

:shock:

Good translator. Which one is it?

mihey 7. Jan 2005 13:15

Re: Ich kann nicht gelesen icon zeichnen.
 
Zitat:

Have you tried to use Graphics32 (TBitmap32) Library (www.g32.org) to solve your problem?
I thought of that and decided it won't do. I have no problems displaying pf32bit TBitmap as I want. If I use TBitmap32, I will have to convert every icon bitmap data into 32-bit bitmap data, that means much work with palette. But the main problem will raise when I try to save a 4-bit icon, for example, from 32-bit bitmap. If a TBitmap32 was modified, I will have to check if the number of colors doesn't exceed the limits of 4-bits.

The thing is that I want to know what is wrong with my code. You know, it's like a question of principle. So much time was killed.

Zitat:

Good translator. Which one is it?
It's http://www.paralink.com , but I used translation from Russian into German.

mihey 7. Jan 2005 15:54

Re: the same
 
Oops... the message here was not right, it was my mistake.


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:21 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz