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

How to mofify an image with V.Fortran

brenier
Beginner
457 Views
I want to modify a jpeg (or gimp, or bmp) image by addition of a transparent layer.
Image is done by n*m pix.
Layer is known as a n*m matrix of coefficients computed with Fortran (Compaq).
(It is possible to view matrix with Compaq Array Visualizer)
I need to put "matrix view" over the image to high light results on the original map, and I must save image modified.
Is someone know how to do this?
Thankyou
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
457 Views
You may take a look at my XFTGDI Module. (Make sure to download the documentation too). It could simplify the task, but currently it cannot load/save jpeg (only a bmp), and it doesn't have direct mechanism for creating a bitmap from matrix other than XSetPixel. The code could look along these lines:
USE XFTGDI
...
TYPE(X_DC):: xDC
TYPE(X_BITMAP):: xBmp
...
xDC = XMemoryDC(200,200)
!You can call XSetPixel, XLine, XRectangle, 
!XPlaceBitmap etc. to modify the image:
DO iX = 1,200
   DO iY = 1,200
      i = XSetPixel(xDC, iX, iY, someColor)
   END DO
END DO
i = XGetBitmap(xDC, xBmp, 0, 0, 200, 200)
i = XSaveBitmap(xBmp, "MyBitmap.bmp")
i = XDeleteBitmap(xBmp)
i = XDeleteDC(xDC)


Jugoslav
0 Kudos
Reply