- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve:
I was looking to use some Fortran code to fill in BITMAP arrays and then export the image to a BMP file. I found a couple of sample codes online, one from a Stanford Prof is old school Fortran, but it works well.
I looked in the samples, but did not see anything of use. I looked at the Forum posts from 2002 onwards, but this is a lot of QUICKWIN stuff and I do not enjoy that route at all.
Are you aware of any simple plain code that will allow me to create BITMAPS in Fortran -- I tried the
module RCImageBasic implicit none type rgbimage integer, dimension(:,:), pointer :: red, green, blue integer :: width, height end type rgbimage type rgb integer :: red, green, blue end type rgb interface operator (==) module procedure rgbequal end interface interface operator (.dist.) module procedure colordistance end interface
but it saves as a PPM, which needs GIMP and I prefer Paint.net.
Any thoughts
JMN
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The only bitmap functions we provide relate to QuickWin. See http://msdn.microsoft.com/en-us/library/dd183377(v=vs.85).aspx for a list of Windows API functions for dealing with bitmaps - these will be defined in module GDI32.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve:
I thought that was the answer, but I just wanted to check.
DISLIN appears to be the other way to go. I am about to try it with IFORT.
This all started because I found a brief code in C for a Water Supply Analysis system and I thought putting it into Fortran would be fun. Without mecej4 I would still be back using a lousy inversion routine. PARDISO is sweet, but http://en.wikipedia.org/wiki/Paradiso_(Amsterdam) is actually a building.
It is fun, but it is a much bigger exercise than I anticipated.
I was reading the EPANET manual and it suggested the C code had unlimited nodes. This clearly is not true.
JMN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Warning: possible duplicate message. I was interrupted by a captcha last time.
ifort has all you need to save .BMP images to a file because it has OpenGL and Win32 API interfaces. There is a crude example on the web at http://home.comcast.net/~kmbtib/Fortran_stuff/avl.zip . It's so poorly documented that it's even hard to see what it's supposed to do, but if you unzip into a folder and run the executable and open the only .DAT file available, then hit the <ENTER> key a few times and then the W key it makes a .BMP file! Subroutine drawBmp is responsible for drawing the BMP and saving it to disk. OpenGL draws much nicer images than gdi32 functions do, but it's not a simple API. Having a working example to build from is a big plus.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What are you trying to do? I have a Fortran routine that captures a full window (or the client area of a window) and saves it to a specified bitmap file, this uses using the windrows sdk. You can have it if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Guys:
Thanks heaps. This is for my water supply analysis program MAGNI - Norse God Thor's son, name means Strong.
I have taken the standard gradient algorithm and with a lot of help from mecej4 and others got it running with PARDISO. This had been one of my Holy Grail Quests since '88. The program now handles quite complex models, so the problem one runs into is looking at the results. I can easily output the results as DXF files, which are very easy to write and debug, but not everyone has AutoCAD so I was looking to make some bitmap images of the results. Bitmaps is not something I have touched in Fortran.
If you want to see how some people get to live in Heaven now, have a look at http://www.lakelandcam.co.uk/ - scan down for the pictures.
JMN

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page