Using Win32 functions in Visual FoxPro Image Gallery
GDI+ Graphics
..msdn
GdipCreateFromHDC
GdipCreateFromHDC2
GdipCreateFromHWND
GdipDeleteGraphics
GdipDrawImageI
GdipDrawImageRectI
GdipDrawImageRectRectI
GdipDrawLineI
GdipDrawPieI
GdipDrawRectangle
GdipFillPieI
GdipFillRectangle
GdipGetDC
GdipGetDpiX
GdipGetDpiY
GdipGetPageScale
GdipGetPageUnit
GdipGetSmoothingMode
GdipReleaseDC
GdipResetWorldTransform
GdipRotateWorldTransform
GdipSetClipRectI
GdipSetPageScale
GdipSetPageUnit
GdipSetSmoothingMode
GdipSetTextRenderingHint
GdipSetWorldTransform
GdipTranslateWorldTransform
Code examples:
Custom GDI+ class
Custom GDI+ class

User rating: 9.5/10 (2 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Before you begin:
Note: since this CGI+ class library uses Collections and Try/Catch error handling,
it requires at least VFP8.


The gdiplusinit object must be created before instantiating first gdi+ object in the application.

Code samples based on this class:
  1. converting image file to another graphics format
  2. sending image file to printer
  3. saving image of FoxPro form to file
  4. printing image file
  5. sending image of FoxPro form or image file to the Clipboard
  6. copying data from the Clipboard to an image file
  7. reading and writing metadata in JPEG and TIFF files
  8. loading image file, drawing on it, saving the result to another file
  9. scaling images
  10. cropping images
  11. rotating images
  12. using Scale and Shear transformations
  13. extracting icon resources and saving in image files
  14. converting image file to .ICO file
  15. enumerating fonts installed on the system
  16. GDI+: printing vertical text on VFP reports via generated images
  17. converting lines of text to an image and saving in a graphics file
  18. obtaining list of installed image encoders and decoders
  19. drawing a Pie Chart
  20. creating a gradient
  21. scrolling through large image with the mouse
  22. extending user interface: controls that shake
  23. image scrolling with inertia
  24. custom Clock Control
The library contains 14 classes and about 70 GDI+ declarations.
 
  Members area. Log in to view this example.
 
  User name:
  Password:
 
 
  Forgot your password?
 
  Sign up for
the Membership
 
  Buy this example for $20.00
Instant email delivery.

Read more...
 


User rating: 9.5/10 (2 votes)
Rate this code sample:
  • ~
32589 bytes  
Created: 2004-07-05 15:59:17  
Modified: 2013-12-20 12:43:07  
Visits in 7 days: 173  
Listed functions:
CLSIDFromString
DeleteObject
GdipCloneBitmapArea
GdipCreateBitmapFromGdiDib
GdipCreateBitmapFromGraphics
GdipCreateBitmapFromHBITMAP
GdipCreateBitmapFromHICON
GdipCreateFont
GdipCreateFontFamilyFromName
GdipCreateFromHDC
GdipCreateFromHDC2
GdipCreateFromHWND
GdipCreateHBITMAPFromBitmap
GdipCreateHICONFromBitmap
GdipCreateMatrix
GdipCreateMatrix2
GdipCreatePen1
GdipCreateSolidFill
GdipCreateStringFormat
GdipDeleteBrush
GdipDeleteFont
GdipDeleteFontFamily
GdipDeleteGraphics
GdipDeleteMatrix
GdipDeletePen
GdipDeleteStringFormat
GdipDisposeImage
GdipDrawImageRectI
GdipDrawRectangle
GdipDrawString
GdipFillRectangle
GdipGetDC
GdipGetFamilyName
GdipGetFontCollectionFamilyCount
GdipGetFontCollectionFamilyList
GdipGetImageFlags
GdipGetImageGraphicsContext
GdipGetImageHeight
GdipGetImageRawFormat
GdipGetImageType
GdipGetImageWidth
GdipGetMatrixElements
GdipGetSmoothingMode
GdipInvertMatrix
GdipIsStyleAvailable
GdipLoadImageFromFile
GdiplusShutdown
GdiplusStartup
GdipMeasureString
GdipNewInstalledFontCollection
GdipReleaseDC
GdipResetWorldTransform
GdipRotateMatrix
GdipSaveImageToFile
GdipScaleMatrix
GdipSetMatrixElements
GdipSetSmoothingMode
GdipSetTextRenderingHint
GdipShearMatrix
GdipTranslateMatrix
GetDesktopWindow
GetObjectType
IsWindow
StringFromGUID2
Printer friendly API declarations
My comment:
Microsoft® Windows® GDI+ exposes a flat application programming interface (API) that consists of about 600 functions implemented in Gdiplus.dll.

C:\Program Files\Common Files\Microsoft Shared\VFP\gdiplus.dll
Check if you have the latest version of gdiplus library installed.

For C++ developers the functions in the GDI+ flat API are wrapped in about 40 C++ classes. Visual FoxPro developers are not able to instantiate any such class in pure FoxPro code. That is why the flat API makes a good choice.

July 5, 2004: Visual FoxPro 9 presents new property GdiPlusGraphics. My understanding is that this property is applicable to the ReportListener and probably to the _SCREEN and FoxPro Form objects.

Recommended reading:

Articles of Markus Egger.
  • The Basics of GDI+
  • Using GDI+ in ASP.NET Web Applications, Part 1
  • Using GDI+ in ASP.NET Web Applications, Part 2

    Using GDI+ in the VFP 9 Report Writer by Christof Wollenhaupt published in July 2004 issue of FoxPro Advisor.

    Get to Know .NET GDI+ by Ken Getz published in March 2003 issue of FoxPro Advisor.

    * * *
    There is another GDI+ class written by Alexander Golovlev that you can find in UniversalThread download section. This class is freeware and contains lot of useful functionality.

    * * *
    Aug.04, 2004: GDI+ Foundation Class to be shipped with VFP9 final release. Read Using GDI+ in VFP 9.0 with the FFC Library, Part 1 article in Fox Talk.

    Finally it is shipped on August 6, 2004.

    * * *
    BINTOC() accepts new parameter in VFP9: bintoc(m.tW,"F") -- conversion to 32-bit float format. That probably makes conversion routines Int2Float and Float2Int in the code above obsolete.

    * * *
    May 10, 2006: Names of properties of RECT class have been changed from (Left, Top, Width, Height) to (rleft, rtop, rwidth, rheight). RECTF, a subclass of RECT, could not properly access the methods of the parent class because of those risky names.

    * * *
    May 19, 2006: Errors may occur when moving, deleting or copying graphics files that have been used recently for creating GDI+ objects. Most likely those objects still exist in memory and must be released to enable file operations. This is in a way similar to VFP CLEAR RESOURCES command not clearing cached bitmap file if it is still used in Picture property.
  • 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-2014 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.68), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Google
    Advertise here!