Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi How to save cursor from resource? (https://www.delphipraxis.net/181945-how-save-cursor-resource.html)

WojTec 19. Sep 2014 14:29

Delphi-Version: XE5

How to save cursor from resource?
 
I have tree with resources from executable. I'm getting it as below:

Delphi-Quellcode:
ICO.Handle := CreateIconFromResourceEx(Memory, Size, &Type = Longint(RT_ICON), $30000, 0, 0, 0);


If I want to display it (eg. assign TIcon to TBitmap), this working for both icons and cursors, but if I want to save it, this working only for icons and for cursors raises exception class EInvalidGraphic with message 'Bitmap image is not valid'.

F1, please :(

WojTec 19. Sep 2014 18:38

Re: How to save cursor from resource?
 
Question propably should sound: "How to save hIcon to file?" :?:

Der schöne Günther 19. Sep 2014 19:32

AW: How to save cursor from resource?
 
Can you provide a sample resource you're trying to extract a cursor from?

WojTec 20. Sep 2014 09:25

Re: How to save cursor from resource?
 
Liste der Anhänge anzeigen (Anzahl: 1)
Sure. This is standard SQL cursor attached by XE6 (raw stream and extracted by another tool).

Let's repeat: icon or cursor created from this stream by CreateIconFromResourceEx() can be loaded to display, but if I want to save it as valid icon or cursor, TIcon raises exeption I told when cursor is created.


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:28 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