*---------------------- Location Section ------------------------ * Library: Iconbuddy.vcx * Class: Iconbuddy * Method: Createtmppicture() *----------------------- Usage Section -------------------------- *) Description: *) * Scope: Public * Parameters: *$ Usage: *$ * Returns: *--------------------- Maintenance Section ---------------------- * Change Log: * CREATED 09/02/2005 - NN (Frank Dietrich) * MODIFIED *---------------------------------------------------------------- lparameters tcFile as string local lcExtension, loItem, lcIconFile, lcOutFile, ; lcOutStem, loIconLarge, loIconSmall, lnIconsFound, lcTempPath, ; ogpInit, ogpImage *-- Get the extension of the given file lcExtension = lower(justext(tcFile)) *-- and see if we already have an icon for it lcIconFile = this.GetIconFile(lcExtension) if empty(lcIconFile) *-- Not in the collection yet loItem = createobject("EMPTY") addproperty(loItem, "cIconLarge", "") addproperty(loItem, "cIconSmall", "") addproperty(loItem, "cFileType", "") *-- now extract the icons for the filetype loIconLarge = null loIconSmall = null lnIconsFound = this.GetAssocIconPairObjects(tcFile, @loIconLarge, @loIconSmall) if lnIconsFound = 2 IF VARTYPE(this.ogpInit) <> "O" this.ogpInit = newobject("gpinit", "gpImage.prg") && <-- needed as a basis for gpImage this.ogpImage = newobject("gpimage", "gpImage.prg") endif lcTempPath = addbs(sys(2023)) *-- Save the IconObject to disk lcOutStem = "PCT" + sys(2015) lcOutFile = lcTempPath + lcOutStem + "_L.BMP" lcTempPath = addbs(sys(2023)) *-- load the large Icon into the gpImage-Class this.ogpImage.FromPicture(loIconLarge) *-- And save it as a bitmap this.ogpImage.SaveAsBMP(lcOutFile) *-- and keep for further reference loItem.cIconLarge = lcOutFile *-- and do the same with the small icon lcOutFile = lcTempPath + lcOutStem + "_S.BMP" *-- load the small Icon into the gpImage-Class this.ogpImage.FromPicture(loIconSmall) *-- And save it as a bitmap this.ogpImage.SaveAsBMP(lcOutFile) *-- and keep for further reference loItem.cIconSmall = lcOutFile loItem.cFileType = this.cFileType endif *-- ... and add the Item to the Collection this.oIcons.add( loItem, lcExtension ) endif return>Naomi,