forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

%ss and browse_for_folder@ under 64bit
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5437
Location: Salford, UK

PostPosted: Tue Sep 06, 2016 10:48 am    Post subject: Reply with quote

Chemie

I have had a quick look at get_dib_block@ and put_dib_block@.
The coding depends on the type of file (jpeg etc.), whether you are using GDI+, and possibly other factors.

If you could post a short sample program then initially it might be possible to provide progress bar feedback for that specific situation.
Back to top
View user's profile Send private message
Chemie



Joined: 07 Mar 2015
Posts: 48

PostPosted: Wed Sep 07, 2016 9:25 am    Post subject: Re: Reply with quote

Paul,
here is a little testprogram for my usual use of get_dib_block@. I have masked out the calls for progress_bar@, because I could not yet use them now.

winapp
program progresstest
use mswin
implicit none

! c_external progress_bar@ "__progress_bar"(REF)
double precision fill
integer*4 xsize,ysize,i1,a,bildctrl,picsizex,picsizey
integer*4 rgbblau,func,mode,errcode,nbbp,ercode,allocerror

character*1, dimension(:,:,Smile, allocatable :: picture
i1=1
xsize=2000
ysize=1500
rgbblau=rgb@(0,0,255)
fill=0.0
bildctrl=0

a=winio@('%ca[test]&')
a=winio@('%gr&',xsize,ysize)
a=winio@('%ff%rj%10br&',fill,rgbblau)
a=winio@('%lw',bildctrl)

call get_dib_size@('test.jpg',picsizex,picsizey,nbbp,ercode)
allocate(picture(3,picsizex,picsizey),stat=allocerror)
! call progress_bar@(fill)
call get_dib_block@('test.jpg',picture,picsizex,picsizey,0,0,picsizex,picsizey,0,0,errcode)


! call progress_bar@(fill)
call display_dib_block@(0,0,picture,picsizex,picsizey,i1,i1,xsize,ysize,func,mode,errcode)
end

The second call of progress_bart@ is not necessary, because display_dib_block@ is so fast, that we can't see the bar.

Thanks
Chemie
Back to top
View user's profile Send private message
Chemie



Joined: 07 Mar 2015
Posts: 48

PostPosted: Sun Sep 11, 2016 9:01 am    Post subject: Re: Reply with quote

Paul,
in case of get_dib_block@ there are another two remarks:
1. Please remember that get_dib_block@(and also get_dib_size@) crashes, when the jpeg identifier (JFIF-Tag = FF E0 00 10 4A 46 49 46 00 01 01 01 00 B4 00 B4 00 FF E1) is missing.This is unusual but allowed, for example the jpeg-files of my digitalcamera are without JFIF-Tag.
2. Is it possible to extend get_dib_block@ also for png-files? This is one part of my wishlist.

Another part of my wishlist is a pendant to the (DOS)-command "wget". Now, I help me with WinExec('wget [option]...[url]',error), but this is not a good solution.

Thanks
Chemie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5437
Location: Salford, UK

PostPosted: Mon Sep 12, 2016 8:17 am    Post subject: Reply with quote

Items 1 and 2 might work if you were to call USE_GDIPLUS_IMAGE_FILES@. See cwplus.enh.

I am not familiar with wget but the routine DOWNLOAD@ might be appropriate.
See ftn95.chm.
Back to top
View user's profile Send private message
Chemie



Joined: 07 Mar 2015
Posts: 48

PostPosted: Mon Sep 12, 2016 3:50 pm    Post subject: Re: Reply with quote

Hi Paul,
many thanks. Your Info was very useful for me. With read_url@ (the pendant to wget) and use_gdiplus_image_files@ I can get and display some png-files from the web four times faster than before.
Chemie
Back to top
View user's profile Send private message
Chemie



Joined: 07 Mar 2015
Posts: 48

PostPosted: Wed Oct 12, 2016 4:05 pm    Post subject: Re: Reply with quote

Hi,
I always have problems with get_dib_block@. Look at my testprogram

winapp
program pngtest
use mswin
implicit none

integer*4 xsize,ysize,a,bildctrl,picsizex,picsizey,urlmode
integer*4 func,mode,errcode,nbbp,ercode,urlerror,allocerror

character*255 filename,url
character*1, dimension(:,:,Smile, allocatable :: picture

xsize=2048
ysize=1536
xsize=256
ysize=256

urlmode=1
bildctrl=0
url='http://tile.openstreetmap.org/15/16515/12525.png'
filename='test.png'

a=winio@('%ca[test]&')
a=winio@('%gr&',xsize,ysize)
a=winio@('%lw',bildctrl)

call read_url@(url,filename,urlmode,urlerror)
a=use_gdiplus_image_files@(1)
call get_dib_size@(filename,picsizex,picsizey,nbbp,ercode)

allocate(picture(3,picsizex,picsizey),stat=allocerror)

call get_dib_block@(filename,picture,picsizex,picsizey,0,0,picsizex,picsizey,0,0,errcode)

a=winio@('%ca[Result]&')
a=winio@('%nlResult: %wd %wd %wd %wd %wd %wd&',picsizex,picsizey,urlerror,nbbp,ercode,errcode)
a=winio@('%2nl%cn%9`bt[OK]')

call display_dib_block@(0,0,picture,picsizex,picsizey,0,0,xsize,ysize,func,mode,errcode)

end

when I use 256 for xsize, ysize, all is going well, but the errorcodes are wrong, there will be errcode=2(read error) for get_dib_size@ and 1 for get_dib_block@ (this error is not reported).
But when I alter xsize and ysize to e.g. 2048 and 1536, the grogram crashes. Why I can't insert a small picture in a big graphics area?
Thanks for your help
Chemie
Back to top
View user's profile Send private message
Chemie



Joined: 07 Mar 2015
Posts: 48

PostPosted: Wed Oct 12, 2016 4:10 pm    Post subject: Re: Reply with quote

Sorry, my fault,
the program crashes not, when I use the correct values in display_dib_block@:

call display_dib_block@(0,0,picture,picsizex,picsizey,0,0,picsizex,picsizey,func,mode,errcode)

but the errcodes are always incorrect.

Chemie
Back to top
View user's profile Send private message
Chemie



Joined: 07 Mar 2015
Posts: 48

PostPosted: Sun Oct 30, 2016 11:20 am    Post subject: Re: Reply with quote

Sorry, I have rearranged my testprogram new.

winapp
program pngtest
use mswin
implicit none

integer*4 xsize,ysize,a,imagectrl,picsizex,picsizey,urlmode
integer*4 func,mode,nbbp,urlerror,sizeerrcode,allocerror,blockerrcode,displayerrcode

character*255 filename,url
character*1, dimension(:,:,Smile, allocatable :: picture

xsize=1200
ysize=900

urlmode=1
url='http://tile.openstreetmap.org/15/16515/12525.png'
filename='test.png'
call read_url@(url,filename,urlmode,urlerror)

a=winio@('%ca[test]&')
a=winio@('%gr&',xsize,ysize)
a=winio@('%lw',imagectrl)

a=use_gdiplus_image_files@(1)
call get_dib_size@(filename,picsizex,picsizey,nbbp,sizeerrcode)

allocate(picture(3,picsizex,picsizey),stat=allocerror)

call get_dib_block@(filename,picture,picsizex,picsizey,0,0,picsizex,picsizey,0,0,blockerrcode)
call display_dib_block@(0,0,picture,picsizex,picsizey,0,0,picsizex,picsizey,func,mode,displayerrcode)

a=winio@('%ca[Result]&')
a=winio@('%nlUrl_error: %wd&',urlerror)
a=winio@('%nlImagesize: %wd %wd&',picsizex,picsizey)
a=winio@('%nlGet_dib_size_error: %wd&',sizeerrcode)
a=winio@('%nlAlloc_error: %wd&',allocerror)
a=winio@('%nlGet_dib_block_error: %wd&',blockerrcode)
a=winio@('%nlDisplay_dib_block_error: %wd&',displayerrcode)
a=winio@('%2nl%cn%9`bt[OK]')

end

Why I get an error (errcode=2) in get_dib_size@. Is that only my pc, who produce the error? The file test.png was ok, I can read the file with several programs without errors.
What is about the error (errcode=1) of get_dib_block@? This error is not in the errorlist of get_dib_block@. The display is ok, therefor it is not understandable, that the errcodes are not zero.
Thanks for your help.
Chemie
Back to top
View user's profile Send private message
Chemie



Joined: 07 Mar 2015
Posts: 48

PostPosted: Mon Jan 02, 2017 11:38 am    Post subject: Re: Reply with quote

Hi Paul,
first, a happy new year for you and all others.
Now, I have problems with your newdlls14 and newdlls15. I have tryed them and I get with the following program an error:

winapp

program integer7test
use mswin
implicit none

integer*4 a,xpic,ypic,picctrl
integer(7) pichandle

xpic=1000
ypic=800

a=winio@('%ca[Picture]&')
a=winio@('%gr&',xpic,ypic)
a=winio@('%hw&',pichandle)
a=winio@('%lw',picctrl)

end

pichandle is definitly integer(7), but the program crashes.
Perhaps, there are further newdlls, where can I get the latest newdlls?
Thanks
Chemie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5437
Location: Salford, UK

PostPosted: Mon Jan 02, 2017 5:50 pm    Post subject: Reply with quote

Chemie

I think that the problem is that there is now a miss-match between the compiler and the DLLs. This is the danger when pre-releasing DLLs for testing whilst still using the main release of the compiler.

It may be necessary to wait for the next full release before this issue is resolved.
Back to top
View user's profile Send private message
sisutcliffe



Joined: 01 Aug 2006
Posts: 5

PostPosted: Wed May 02, 2018 9:30 am    Post subject: browse_for_folder@ Reply with quote

A long time ago this thread noted issues with browse_for_folder@ which Paul then told us was fixed. Has anyone seen any regressions?

I don't think my program could get any simpler but always ends up with an access violation at the moment:

Code:

winapp

program bug
  use mswin

  character(len=50) :: temp

  if( browse_for_folder@('Folder?',temp) )then
    write(*,*) temp
  else
    write(*,*) 'Failed'
  endif

  stop 0
end program


We get
Quote:

Error: Access Violation reading address 0x0

GET_CSTRING@
BUG


Does anyone have any ideas please? We're using 8.30
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5437
Location: Salford, UK

PostPosted: Wed May 02, 2018 10:45 am    Post subject: Reply with quote

You just need a larger character variable...

Code:
character(len=550) :: temp


Maybe ClearWin+ can be made to send you a warning.
Back to top
View user's profile Send private message
sisutcliffe



Joined: 01 Aug 2006
Posts: 5

PostPosted: Fri May 04, 2018 8:47 am    Post subject: Reply with quote

Thanks Paul, a) not sure why that didn't occur to me and b) interesting that the requirement has changed between 32 and 64bit!
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 858

PostPosted: Fri May 04, 2018 11:42 pm    Post subject: Reply with quote

Why len=550 ?
_________________
"This is the triumph of folly.
The machine, which knows no rest, ought to remain a tool,
... but instead becomes our master and will swallow up our life and soul"
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 858

PostPosted: Fri May 04, 2018 11:46 pm    Post subject: Reply with quote

Digressing a little, I see there's a BROWSE_FOR_FOLDER1@ also.

One of the parameters is 'FLAGS'.
An example is given that:
Quote:
FLAGS can be used to customise the appearance of the dialog box. Passing z'40' allows for features like folder creation. A full list of the flags is available in the documentation for the ulFlags member of the BROWSEINFO structure.


Now, looking at the link to the documentation for BROWSEINFO_ Structure, ia all gobbldygook to me and there's no mention of z'40' nor 'folder creation'.
Can several 'flags' be specified at the same time and how ?
_________________
"This is the triumph of folly.
The machine, which knows no rest, ought to remain a tool,
... but instead becomes our master and will swallow up our life and soul"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 5 of 6

 
Jump to:  
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