Here is the complete Intel code sample (I can’t get the whole thing to format as code): (Visual Studio is also not required to use the Windows API.) The code sample from requires some modules (Constant and Toolbar) that they must have created themselves, as those are not part of Intel Fortran. All that is necessary is a compiler that supports the STDCALL calling mechanism (on 32-bit only, not an issue on 64-bit), a declaration of the appropriate derived type, and linking against comdlg32.lib (part of the Windows SDK). It does, however, include predefined declarations that make it easier. I even got asked if I could improve the code/user experience further for Intel Fortran is not required to use the Windows API routines. The purpose of the program was to measure the surface tension of a liquid drop from a set of images and produce a small text report. As soon as I added the file selection dialog box, they found it much more convincing and easier to use. In the first iteration of the program I had a command-line interface, but the users (fellow scientists and master students), were not that happy to work with it. Recently, I did a project in MATLAB where I used the uigetfile function (“Open file selection dialog box”). While it might be difficult to get it to work across operating systems, a simple file dialog can be a very effective way to bring a program closer to the users. API for file system operations: directory manipulation. Well there is a file system operation module in development (see here) which aims to work across operating systems. Ret=TextOut(iret,100,100+100*i,FileBuf,LEN(FileBuf)) !输出新的字母Ĭoncerning dlgopenfile() and dlgsavefile() or equivalent, I doubt they could be included in the Fortran standard library because it’s too dependent on the operating system. Ret = convertFtoCstring(lpStrPtr,OpenFN%lpstrFile) If ( IAND( OpenFN%Flags, OFN_READONLY ). Type(T_OPENFILENAME) :: OpenFN !定义OPENFILENAME结构体 Please familiarize yourself with the license terms before distributing software using AppGraphics.This is what you want, but you need VS+Intel Fortran: More information is available on the licensing page. Users wishing to distribute software linking to the AppGraphics library are encouraged to do so there are no further royalties to be paid for distributing software utilizing this library. All additions and improvements beyond WinBGIm are copyrighted by Approximatrix, LLC. LicensingĪppGraphics is based loosely on the excellent WinBGIm library, a public domain graphics library for Microsoft Windows. Please see the Threads section for more information. However, if the underlying application is relying on allocated memory that is to be reallocated or freed during a callback, the user should consider implementing some mutual exclusions, or mutexes, to avoid accessing memory that is no longer available from either the callback or the main program. Any callbacks from menus or buttons will be called from the graphical user interface thread, which, generally speaking, is safe to do. In order to remain responsive when work is being performed, the AppGraphics library heavily relies on a separate thread for managing the graphical user interface. Users should take care in determining what values are passed into the library. The GDI will attempt to draw this circle regardless of the size, and it can cause an apparent or actual lockup of the Windows graphical user interface while the operation is attempted. For example, if the user fails to initialize a radius variable when drawing a circle, the value may be some random, large quantity. However, being a low-level library, the user must be careful not to perform unrealistic requests. This library comes with Windows, and it continues to be supported in modern versions of the operating system. The AppGraphics library makes use of Microsoft’s GDI+ drawing routines to perform all drawing operations. The drawing code borrows from the WinBGIm library, which allows for drawing lines, shapes, and images within a window. The library has been designed for simplicity first and foremost it hides much of the complicated Microsoft Windows code from the user. This library allows users to open windows, draw various shapes within windows, add menus and simple controls, open common file dialogs and message boxes, and save or print window contents. Welcome to AppGraphics, a simplified graphics library for C and Fortran from Approximatrix.
0 Comments
Leave a Reply. |