Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Retrieving current settings for an ODBC connection
Reading current hardware profile
Time in milliseconds represented as string (e.g. 1 hour 24 min 36 sec)
Using the FindMediaType function
Winsock: retrieving information from a host database for a given host name
How to release and renew a lease on an IP address previously obtained through Dynamic Host Configuration Protocol (DHCP)
Saving available locale records into a cursor
Using an Event Object. Part B: running an application responding to events
Clipping mouse cursor area
Reading Internet Query options
Retrieving list of Global Atom names
Retrieving the priority class for the current process
Retrieving the state of your Internet connection
Scanning a hierarchy of child windows down from the Windows Desktop
Using MessageBeep
WAV file recorder
Converting long file names to the short format and vice versa
Reading and setting explicit Application User Model ID for the current process (Win7)
Retrieving graphic capabilities of your display
Terminating VFP application using the FatalAppExit
URL: converting unsafe characters and spaces into escape sequences
Using GetSysColor
Using the Semaphore object
Creating hash values for the list of names
GDI+: converting image file to another graphics format

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Versions:
click to open
Before you begin:
The code is based on custom GDI+ class. Download the class module first and save it in gdiplus.prg file.

Make sure the source and target file names are valid. The source file can be in any of graphics formats supported by the GDI+: BMP, GIF, JPG, TIF, EMF...

 
SET PROCEDURE TO gdiplus ADDITIVE
 
* an instance of gdiplusinit should be created before
* and released after using any of gdi+ objects
PRIVATE gdiplus
gdiplus = CREATEOBJECT("gdiplusinit")
 
LOCAL img
img = CREATEOBJECT("gdiimage", "c:\windows\forest.bmp")
WITH img
    .SaveToFile("d:\temp\tmp.bmp")
    .SaveToFile("d:\temp\tmp.gif")
    .SaveToFile("d:\temp\tmp.jpg")
    .SaveToFile("d:\temp\tmp.png")
    .SaveToFile("d:\temp\tmp.tif")
ENDWITH
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
452 bytes  
Created: 2004-07-05 19:40:43  
Modified: 2011-12-10 09:20:22  
Visits in 7 days: 62  
Listed functions:
Printer friendly API declarations
My comment:
The base class has encoder CLSIDs implemented as constants. Event though it works perfectly, in real-life programming I suggest using the GdipGetImageEncoders function to retrieve parameters of the image encoders currently available on the system.
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (50.16.132.180)
1.36 hrs.Example: 'How to find when the application started'
 Function: 'OpenEventLog'
 Function: 'HeapLock'
Function group: 'Memory Management'
2.69 hrs.Function: 'MapVirtualKey'
 Function: 'GetCurrentThread'
3.39 hrs.Function: 'GdiplusStartup'
 Function: 'WNetDisconnectDialog'
4.62 hrs.Function: 'SHGetStockIconInfo'
 Function: 'EndUpdateResource'
Function group: 'Resource'
 Example: 'GetFocus returns a HWND value'
Google
Advertise here!