 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Sat Jan 31, 2015 5:54 am Post subject: |
|
|
Paul,
1) JPG and BMP are OK but GIF or PNG are not. Other types were not checked
2) The code i made in the hurry has some defect: Program crashes when you push esc, no time to investigate why. Just ignore
3) Some additional suggestions: confusing diagnostics.
if you by mistake do not declare hres and vres as integer the compiler gives confusing diagnostics below instead of clearly saying that it expected integers
0024) allocate ( ImageArr(3,hres, vres), stat = kAllocOK)
*** Operand incompatible with opcode
Here is code
Code: |
INTEGER , EXTERNAL :: DropFiles
i=winio@('%ww[no_border]&')
i=winio@('%bg[#cc9999]&')
i=winio@('%si! Drag-n-drop BMP file here %ff %ff&')
i=winio@('%dr&', DropFiles)
i=winio@('%ac[Alt+X]&','exit')
i=winio@(' %ff %cn%tt[OK]')
END PROGRAM
integer function DropFiles()
use clrwin
character*128 filename1
integer*1, dimension(:,:,:), allocatable :: ImageArr
integer hres, vres, colours, ier
filename1 = clearwin_string@ ('DROPPED_FILE')
call get_dib_size@(filename1, hres, vres, nb_colours, ier)
print*,' hres,vres,nb_colours=',hres, vres, nb_colours
kAllocOK=0
allocate ( ImageArr(3,hres, vres), stat = kAllocOK)
if (kAllocOK /= 0) write (*,*) 'Allocation problem #', kAllocOK, hres, vres
call get_dib_block@(filename1,ImageArr,hres, vres,0,0,hres, vres,0,0,ier)
if(ier.ne.0) Print*, 'get Err=',ier
i=winio@('%ww&')
i=winio@('%gr[full_mouse_input,rgb_colours,popup]&',hres,vres)
i=winio@('%ac[Alt+X]&','exit')
i=winio@('%ac[esc]&','set', LWwindow_control,0) ! 'exit')
i=winio@('%lw', LWwindow_control)
call display_dib_block@(0,0,ImageArr,hres,vres,0,0,hres,vres,0,0,ier)
if(ier.ne.0) Print*, 'Display Err=',ier
! deallocate(ImageArr, stat = ios)
! if (ios /= 0) then
! print *, "Was nothing to deallocate"
! end if
DropFiles=2
end function
|
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sat Jan 31, 2015 5:38 pm Post subject: |
|
|
You need a call to USE_GDIPLUS_IMAGE_FILES@ in order to activate the new feature. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Sun Feb 01, 2015 6:41 pm Post subject: |
|
|
Added two lines
istate=1
istate0= USE_GDIPLUS_IMAGE_FILES@(istate)
got that this function is missing
NO ERRORS, 2 WARNINGS FTN95/Win32 v7.10.0]
WARNING the following symbols are missing:
USE_GDIPLUS_IMAGE_FILES# |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon Feb 02, 2015 11:27 am Post subject: |
|
|
My apologies for the omission, you will need
Code: | C_EXTERNAL USE_GDIPLUS_IMAGE_FILES@ '__use_gdiPlusForImageFiles' &
&(VAL):INTEGER*4
|
in your clearwin.ins or as temporary line in your program. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Tue Feb 03, 2015 8:20 am Post subject: |
|
|
Works like charm. And does not crash
ADDITION: inserted that into a bit larger code and it does not work. Same story like with LexicalSort. Devilry. Anyone wants to tell me where error is if i post the whole code? Interesting why this @#$% always happen, specifically when i'm in the hurry and pay a lot of attention to not make any mistakes? Nothing works, even posting of this message took several attempts (forum showed just empty post - does not like my OneDrive link)
Last edited by DanRRight on Wed Feb 04, 2015 11:04 am; edited 2 times in total |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Feb 04, 2015 10:08 am Post subject: |
|
|
I have not looked closely at the logic but maybe you need to call USE_GDIPLUS_IMAGE_FILES@(1) at other points in the program as well.
As a test try putting this in every subprogram. |
|
Back to top |
|
 |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Sat Feb 07, 2015 1:03 pm Post subject: |
|
|
Paul,
I added the line
Code: | C_EXTERNAL USE_GDIPLUS_IMAGE_FILES@ '__use_gdiPlusForImageFiles'
* (VAL):integer*4 |
in one of my subroutines as you mentioned, but when linking I get the error message "WARNING the following symbols are missing __use_gdiPlusForImageFiles". What is wrong?
Wilfried |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sat Feb 07, 2015 1:49 pm Post subject: |
|
|
Are you sure that you are still using the salflibc.dll beta version? |
|
Back to top |
|
 |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Sat Feb 07, 2015 5:04 pm Post subject: |
|
|
Yes, after installing the actual FTN95 version, I copied the latest salflibc.dll (dated from 28th of January) into c:\program files (x86)\silverforst\ftn95. I've just controlled that. Should I copy the DLL also into another path?
The error message didn't result from the line C_EXTERNAL ... but from the call to this function (j = use_gdiplus_...).
Wilfried |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sat Feb 07, 2015 5:50 pm Post subject: |
|
|
Maybe there is an old copy of salflibc.dll that is getting in the way.
As a test, try copying the beta DLL to the folder that holds the current executable. |
|
Back to top |
|
 |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Sat Feb 07, 2015 6:03 pm Post subject: |
|
|
It makes no difference... I just scanned my PC for the DLL, I copied the actual one also into the subdirectory ...\redist, but again no difference. I wrote a small test program, same result. I have no idea about the reason.
Wilfried |
|
Back to top |
|
 |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Sat Feb 07, 2015 6:10 pm Post subject: |
|
|
Paul,
I found the solution. I only copied the DLL but not the LIB... Sorry for the trouble I made
Wilfried |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sun Feb 08, 2015 10:04 am Post subject: |
|
|
I still make the same mistake from time to time. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Sun Feb 08, 2015 10:39 pm Post subject: |
|
|
Unfortunately that suggestion did not work and I have absolutely no time to any experiments right now, fixing this thing is not urgent. But hopefully someone has some free time. By the way the program i uploaded could be useful for everyone many times in your lives. Disclaimer is usual - you can modify it at your convenience and use at your discretion, with of course my zero liability.
The zip file has no exe, only source and bat file for your compilation convenience, so nothing to worry about viruses.
This program digitizes graphs. You have always use Ctrl+LeftClick to change or set anything
1) drop the image,
2) Ctrl+LeftClick on the point on the graph X or Y axis at any initial and end points, then right click, set physical coordinates for the four (X0,X1) and (Y0,Y1) points from the graph better for accuracy of digitizing taking a minimum and maximum on the graph (the pixel coordinates x,y will be set automatically). For example it will be (-315,45) and (-1,1) as in the picture below
3) select/highlight the area which contains the graphs (without other things which might interfere, like graph axis, texts etc if they have the same color as digitized curve). For that again use Ctrl and left mouse button moving mouse fom one desired corner to another
4) chose the color of the digitized curve by stepping on the curve and again CTRL+LeftClicking
5) push Digitize button.
The digitized points will appear on the graph with the color and thickness you can additionally set. You can see if any points are correctly digitized.
You can reload the graph if needed
The directory will contain digitized data and settings file for this specific graph with the same name so that next time you just drop the same graph and only click Digitize button
Try it on this curve
But first please find the bug with PNG, GIF etc files . BMP works fine if you set istate=0 in parameters. Turn this GIF file to BMP initially to see how things work, then change istate=1 and use GIF or PNG to see that the code stops working
Last edited by DanRRight on Mon Feb 09, 2015 8:11 pm; edited 1 time in total |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|