Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

pen brush guide for fortran

daoqiang85
Beginner
299 Views
can someone show me a good guide to write a simple pen brush application using visual fortran standard edition?



p/s: i'm totally new in fortran but i know c++.



thanks in advance.



regards,

Ian
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
299 Views
"Knowing C++" doesn't really mean much; GUI programming is kind of world on its own. So, it really depends which tools you want to use...

  • There's simple QuickWin library shipped with VF. It's not very powerful though
  • You can use Windows APIs directly, and VF comes with full translations. It's kind of difficult to use.
  • There are commercial GUI programming packages, like Winteracter and GinoMenu
  • You can check out my free Xeffort library, which integrates with VF. I'm not sure what exactly you want to achieve, but you can check out samples
  • 0 Kudos
    anthonyrichards
    New Contributor III
    299 Views
    You will need to look at the FORTRAN examples, starting with the 'GENERIC' example, to learn
    1) how to create and register a window and store its 'window handle', (typically assigned to a long integer variable frequently named 'hWnd')
    2) how a window procedure works in handling Windows messages
    3) how to find a window's parameters, such as its size, using its window handle
    4) what the window message WM_PAINTmeans and what you need to dotoprocess it correctly
    Further reference to the WIndows SDK will be required to learn
    5) what a window 'device context' is all about and how to get a handle to it (typically assigned to a long integer variable frequently named hDC)
    6) how to define colours using the RGB routines
    7)how to create a pen and how to create a brush of given colours, both processes assigning a 'handle' to each object (typically 'hPen' and 'hBrush')
    8) how to load 'objects' such as a pen or a brush into the window's 'device context' using the handles provided
    9) how to draw onto the window by drawing onto its 'device context'
    10) how to 'update' the window with the newly-drawn data.
    The above assumes you want to use the Windows API routines(all of whose interfaces are supplied in Visual Fortran modules)to use in a fully-portable windows 32-(or 64-) bit application, which is implied by your request about using pens and brushes. If you already know C++, then you should be familiar with all the terms mentioned above, so you just need to learn how to use the FORTRAN versions. Good luck.
    0 Kudos
    Reply