Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert Icon to Bitmap
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Convert Icon to Bitmap
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01046527
Message ID:
01046527
Vues:
76
Herman!

You also have been in the Thread "File association icons" (Starting with Message#1045284) and possibly do know what is coming now ;-) But for the others who might like to join and help us, here the status.

We (Naomi to be precise) needs to get the associated Icons for different file types. However as she's working with Grids instead of ListViews, she'd be better off with Bitmaps instead of Icons.
Using my IconBuddy-Class as well as Alexander Golovlev's gpImage-Class this can be achieved with a few lines of code. This is how it goes:
ogpInit    = newobject("gpinit", "gpImage.prg")  && <-- needed as a basis for gpImage
ogpImage   = newobject("gpimage", "gpImage.prg")
oIconBuddy = newobject("iconbuddy", "iconbuddy")

*-- vars for the Icons
oSmall     = null
oLarge     = null

*-- get the icons for an Excel-File 
? oIconBuddy.GetAssocIconPairObjects(getfile("xls"),@oLarge, @oSmall)

*-- load the large Icon into the gpImage-Class
? ogpImage.FromPicture(oLarge)

*-- And save it as a bitmap
? ogpImage.SaveAsBMP("XL_Large.bmp")

*-- the small one too
? ogpImage.FromPicture(oSmall)
? ogpImage.SaveAsBMP("XL_Small.bmp")

*-- And we're  D O N E ! !
Problem however:
The transparent color of the Icon is converted to black. Unfortnately I was not able to convince her that black-backgrounded icons really *are* cool, and so this is my task now to find a solution how to change the icon's transparent area to a color of choice (preferrably white) *before* converting them to a bitmap.

Could You or any of the other GDI+/API - gurus please give us (me) a hand on that? I also invited Alexander Golovlev. I think he could be of great help.

THX
Regards from Berlin

Frank

Dietrich Datentechnik (Berlin)
Softwarekombinat Teltow (Teltow)

Frank.Dietrich@dd-tech.de
DFPUG # 327
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform