Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ICON on Title Bar of FORM
Message
 
 
À
10/12/2007 15:13:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01274501
Message ID:
01274564
Vues:
13
Hi Cesar,

I guess you should write Part 3 than. :)

>
>Below are 4 simple ways to convert a BMP to ICON, using GdiPlusX.
>Those 2 blog posts were before we updated the library, adding the support for saving Icons with good quality.
>
>This sample uses 4 techniques, and creates 4 versions of ICONS from the same image file.
>Before the conversion, it resizes the source image to the size of 16x16. This means that with this sample you can convert any image to ICO file.
>
>
Do Locfile("system.prg")
>
>With _Screen.System.Drawing As xfcDrawing
>
>* Convert the original bitmap to ensure better quality and compatibility
>   loResized = .Bitmap.New(.Bitmap.FromFile(Getpict()), 16,16)
>
>* Create Icon Object
>    Local loIcon As xfcIcon
>    loIcon = .Icon.FromHandle(loResized.GetHicon())
>
>*** LOW QUALITY ICONS
>
>* Save sending FileName
>    loIcon.Save("c:\Icon_Save_FileName_LowQual.ico")
>
>* Save Using Stream
>    Local loStream As xfcMemoryStream
>    loStream = _Screen.System.IO.MemoryStream.New()
>
>    loIcon.Save(loStream)
>    Strtofile(loStream.GetBuffer(), "c:\Icon_Save_Stream_LowQual.Ico")
>
>
>*** HIGH QUALITY ICONS
>*** Setting the tlQuality flag to .T.
>
>* Save sending FileName
>    loIcon.Save("c:\Icon_Save_FileName_HighQual.ico", .T.)
>
>* Save Using Stream
>    Local loStream2 As xfcMemoryStream
>    loStream2 = _Screen.System.IO.MemoryStream.New()
>
>    loIcon.Save(loStream2, .T.)
>    Strtofile(loStream2.GetBuffer(), "c:\Icon_Save_Stream_HighQual.Ico")
>
>Endwith
>
>Hope this helps
>
>Cesar
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform