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 

Adding text comments to JPG, PNG
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
PaulLaidler
Site Admin


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

PostPosted: Thu Sep 16, 2021 7:42 am    Post subject: Reply with quote

There is a GDI+ function that looks like it will do the job so I have added this request to the wish list.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2451
Location: South Pole, Antarctica

PostPosted: Thu Sep 16, 2021 1:51 pm    Post subject: Reply with quote

As always it was nice discussion on this forum with great help from everyone, thanks to all.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Oct 25, 2021 12:08 pm    Post subject: Reply with quote

Two new functions GET_IMAGE_PROPERTY@ and SET_IMAGE_PROPERTY@ have been added for the next release of ClearWin+. These can be used with jpeg and png files.

For jpeg files, the properties are also accessible via third party applications.

This is not the case for png files because of the lack of a common standard and the current limitations of the Microsoft GDI+ library; but the new functions can still be used together within ClearWin+.

There is also a new subroutine WINDOW_REFRESH@ that updates any visible data that has been changed.

Here is a sample program that illustates the new routines:

Code:
module mm
use clrwin
character file*256,title*50,contents*256
contains
integer function open_cb()
 integer,parameter::N=2
 character(20),parameter::filtn(N) = (/"jpeg files","png files "/)
 character(6), parameter::filts(N) = (/"*.jpg","*.png"/)
 file = " "; title = " "; contents = " "
 call WINDOW_REFRESH@()
 call GET_FILTERED_FILE@("Open",file,"C:\",filtn,filts,N,1)
 if(len_trim(file) > 0)then
  ir = GET_IMAGE_PROPERTY@(file,"T",title)
  ir = GET_IMAGE_PROPERTY@(file,"C",contents)
 endif
 open_cb = DO_REDRAW
end function
integer function save_cb()
 ir = SET_IMAGE_PROPERTY@(file,"T",title)
 ir = SET_IMAGE_PROPERTY@(file,"C",contents)
 save_cb = NO_REDRAW
end function
end module mm

winapp
program main
use mm
file = " "
iw = winio@("%ca[Image Properties]&")
iw = winio@("%bg[BTNFACE]&")
iw = winio@("%`bg[WINDOW]&")
iw = winio@("%2.3ob[line_colour,rounded]&",RGB@(200,200,200))
iw = winio@("File %cb%co[read_only]%`bg%30rs%cb&", RGB@(250,250,250), file)
iw = winio@("Title%cb%co[not_read_only]%30rs%cb&", title)
iw = winio@("Contents  %cb%30.5re%cb&", contents)
iw = winio@("%ff%nl%rj%^bn[Open] %^bn[Save] %bn[Close]", open_cb, save_cb)
end program
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1004
Location: Morrison, CO, USA

PostPosted: Tue Oct 26, 2021 4:53 am    Post subject: Reply with quote

This is great! I have the ability to do this annotation when I create reports or graphics in the PDF (libHaru library), but nothing in the JPEG; until now!

Thanks for adding this!
Bill
Back to top
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2451
Location: South Pole, Antarctica

PostPosted: Thu Oct 28, 2021 7:50 am    Post subject: Reply with quote

Paul, With this demo i got Run-time Error
*** Error 29, Call to missing routine : ___window_refresh at 0x00401045.
00401000 MM!OPEN_CB [+004a] [recur= 1]
00401390 MAIN [+01f0]

Updates for Salflibc DLLs and INCLUDE files seems are latest by 25 and 26 oct
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 -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
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