Using Win32 functions in Visual FoxPro Image Gallery
Device Context
..msdn
ChangeDisplaySettings
CreateCompatibleDC
CreateDC
DeleteDC
DeleteObject
EnumDisplayDevices
EnumDisplaySettings
GetDC
GetDeviceCaps
GetObject
GetObjectType
ReleaseDC
SelectObject
Code examples:
Converting twips to pixels and vice versa
Creating a window using CreateWindowEx function
Drawing standard Windows icons
Form Magnifier
GDI+ fun: roach-infested desktop
GDI+: Color Transparency
GDI+: Creating thumbnails to preview images in a directory
GDI+: Scrolling through large image using the mouse
How to make a VFP form fading out when released (GDI version)
How to view icons stored in executable files (Icon Viewer)
How to view icons stored in executable files (Icon Viewer) - II
Placing an arbitrary rectangular area of main VFP window on the Clipboard
Placing On-screen Alert on top of all windows
Printing text on the client area of the main VFP window
Retrieving graphic capabilities of your display
Using GetNearestColor
Retrieving graphic capabilities of your display

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
 
#DEFINE DRIVERVERSION      0
#DEFINE TECHNOLOGY         2
#DEFINE HORZSIZE           4
#DEFINE VERTSIZE           6
#DEFINE HORZRES            8
#DEFINE VERTRES           10
#DEFINE LOGPIXELSX        88
#DEFINE LOGPIXELSY        90 
#DEFINE BITSPIXEL         12
#DEFINE PLANES            14
#DEFINE NUMBRUSHES        16
#DEFINE NUMPENS           18
#DEFINE NUMFONTS          22
#DEFINE NUMCOLORS         24
#DEFINE ASPECTX           40
#DEFINE ASPECTY           42
#DEFINE ASPECTXY          44
#DEFINE CLIPCAPS          36
#DEFINE SIZEPALETTE      104
#DEFINE NUMRESERVED      106
#DEFINE COLORRES         108
#DEFINE PHYSICALWIDTH    110
#DEFINE PHYSICALHEIGHT   111
#DEFINE PHYSICALOFFSETX  112
#DEFINE PHYSICALOFFSETY  113
#DEFINE SCALINGFACTORX   114
#DEFINE SCALINGFACTORY   115
#DEFINE RASTERCAPS        38
#DEFINE CURVECAPS         28
#DEFINE LINECAPS          30
#DEFINE POLYGONALCAPS     32
#DEFINE TEXTCAPS          34
 
DO decl
 
    LOCAL hdc
    hdc = GetDC(0)  && entire screen
 
    CREATE CURSOR csResult (name C(30), prm N(12))
 
    = AddLog("Driver version", GetDeviceCaps(hdc, DRIVERVERSION))
    = AddLog("Device technology", GetDeviceCaps(hdc, TECHNOLOGY))
    = AddLog("Physical screen, width, mm", GetDeviceCaps(hdc, HORZSIZE))
    = AddLog("Physical screen, height, mm", GetDeviceCaps(hdc, VERTSIZE))
    = AddLog("Screen, width, pixels", GetDeviceCaps(hdc, HORZRES))
    = AddLog("Screen, height, pixels", GetDeviceCaps(hdc, VERTRES))
    = AddLog("Pixels per inch, X", GetDeviceCaps(hdc, LOGPIXELSX))
    = AddLog("Pixels per inch, Y", GetDeviceCaps(hdc, LOGPIXELSY))
    = AddLog("Bits per pixel", GetDeviceCaps(hdc, BITSPIXEL))
    = AddLog("Color planes", GetDeviceCaps(hdc, PLANES))
    = AddLog("Device-spec. brushes", GetDeviceCaps(hdc, NUMBRUSHES))
    = AddLog("Device-spec. pens", GetDeviceCaps(hdc, NUMPENS))
    = AddLog("Device-spec. fonts", GetDeviceCaps(hdc, NUMFONTS))
    = AddLog("Colors in table", GetDeviceCaps(hdc, NUMCOLORS))
    = AddLog("Pixel relative width", GetDeviceCaps(hdc, ASPECTX))
    = AddLog("Pixel relative height", GetDeviceCaps(hdc, ASPECTY))
    = AddLog("Pixel relative diagonal", GetDeviceCaps(hdc, ASPECTXY))
    = AddLog("Clipping capab.", GetDeviceCaps(hdc, CLIPCAPS))
    = AddLog("Entries in sys.palette", GetDeviceCaps(hdc, SIZEPALETTE))
    = AddLog("Res.entries in sys.palette", GetDeviceCaps(hdc, NUMRESERVED))
    = AddLog("Actual color resolution", GetDeviceCaps(hdc, COLORRES))
    = AddLog("Physical page width", GetDeviceCaps(hdc, PHYSICALWIDTH))
    = AddLog("Physical page height", GetDeviceCaps(hdc, PHYSICALHEIGHT))
    = AddLog("Physical offset X", GetDeviceCaps(hdc, PHYSICALOFFSETX))
    = AddLog("Physical offset Y", GetDeviceCaps(hdc, PHYSICALOFFSETY))
    = AddLog("Printer scaling factor X", GetDeviceCaps(hdc, SCALINGFACTORX))
    = AddLog("Printer scaling factor Y", GetDeviceCaps(hdc, SCALINGFACTORY))
    = AddLog("Raster caps", GetDeviceCaps(hdc, RASTERCAPS))
    = AddLog("Curve caps", GetDeviceCaps(hdc, CURVECAPS))
    = AddLog("Line caps", GetDeviceCaps(hdc, LINECAPS))
    = AddLog("Polygon caps", GetDeviceCaps(hdc, POLYGONALCAPS))
    = AddLog("Text caps", GetDeviceCaps(hdc, TEXTCAPS))
 
    = ReleaseDC(0, hdc)
 
    GO TOP
    BROWSE NORMAL NOWAIT
 
PROCEDURE AddLog(lcName, lnPrm)
    INSERT INTO csResult VALUES(m.lcName, m.lnPrm)
 
PROCEDURE decl
    DECLARE INTEGER GetDC IN user32 INTEGER hwnd
    DECLARE INTEGER ReleaseDC IN user32 INTEGER hwnd, INTEGER hdc
    DECLARE INTEGER GetDeviceCaps IN gdi32 INTEGER hdc, INTEGER nIndex
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
3498 bytes  
Created: 2001-11-06 18:58:50  
Modified: 2011-12-10 09:20:22  
Visits in 7 days: 59  
Listed functions:
GetDC
GetDeviceCaps
ReleaseDC
Printer friendly API declarations
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)
3 sec.Function: 'CloseEventLog'
Function group: 'Event Logging'
46.57 min.Example: 'Placing an arbitrary rectangular area of main VFP window on the Clipboard'
46.62 min.Function: 'LookupAccountSid'
52.65 min.Function: 'GetEnvironmentStrings'
Function group: 'Process and Thread'
52.7 min.Example: 'Windows Shell Icons displayed and exported to ICO files (Vista)'
52.75 min.Function: 'socket'
4.53 hrs.Example: 'GDI+: converting image file to another graphics format'
5.89 hrs.Example: 'How to find when the application started'
 Function: 'OpenEventLog'
 Function: 'HeapLock'
Function group: 'Memory Management'
Google
Advertise here!