AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

How to save cursor from resource?

Ein Thema von WojTec · begonnen am 19. Sep 2014 · letzter Beitrag vom 20. Sep 2014
Antwort Antwort
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#1

How to save cursor from resource?

  Alt 19. Sep 2014, 14:29
Delphi-Version: XE5
I have tree with resources from executable. I'm getting it as below:

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
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#2

Re: How to save cursor from resource?

  Alt 19. Sep 2014, 18:38
Question propably should sound: "How to save hIcon to file?"
  Mit Zitat antworten Zitat
Der schöne Günther

Registriert seit: 6. Mär 2013
6.110 Beiträge
 
Delphi 10 Seattle Enterprise
 
#3

AW: How to save cursor from resource?

  Alt 19. Sep 2014, 19:32
Can you provide a sample resource you're trying to extract a cursor from?
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#4

Re: How to save cursor from resource?

  Alt 20. Sep 2014, 09:25
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.
Angehängte Dateien
Dateityp: 7z cur.7z (307 Bytes, 5x aufgerufen)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:19 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