replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - EXPORT_IMAGE@
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 

EXPORT_IMAGE@
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Mon Mar 11, 2013 11:22 am    Post subject: EXPORT_IMAGE@ Reply with quote

I am using the EXPORT_IMAGE@ function for exporting my graphics to the different types of image files.

Everything is working fine except the file type .emf. The function returns a zero value for non-successful execution and no .emf file is created. What might be the problem?

By the way: it would be nice, if EXPORT_IMAGE@ could also support the file type .png.

Detlef Pannhorst
Back to top
View user's profile Send private message Visit poster's website
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Wed Mar 13, 2013 8:43 am    Post subject: EXPORT_IMAGE@ Reply with quote

Since there is no answer yet, I repeat my question:

Is the file type .emf supported, as described in the FTN95 help?

Detlef Pannhorst
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Mar 13, 2013 9:22 am    Post subject: Reply with quote

Sorry I missed your first post.

For me the function creates the file but returns zero.
Also in my sample the background colour of the resulting image is white when it should be black.

What do you get if you ignore the returned zero?

I will log this for further investigation.
Back to top
View user's profile Send private message AIM Address
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Wed Mar 13, 2013 10:01 am    Post subject: Reply with quote

Return code is zero and no emf file is created. All other types are working correctly.
Back to top
View user's profile Send private message Visit poster's website
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: D�sseldorf, Germany

PostPosted: Wed Mar 13, 2013 10:52 am    Post subject: Reply with quote

Detlef, perhaps you can use WMF instead of EMF. You can export graphics as WMF to the clipboard using something like this:

Code:
      j = open_printer1@(7)
      if (j .eq. 1) then
        j = open_metafile@(7)
        if (j .eq. 1) then
c
c         display your graphics to screen
c
          j = metafile_to_clipboard@()
        end if
        j = close_metafile@(7)
        j = close_printer_only@(7)
      end if


Regards - Wilfried
Back to top
View user's profile Send private message
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Wed Mar 13, 2013 11:51 am    Post subject: Reply with quote

Wilfried,

thanks for your suggestion. I have an own routine for writing WMF or EMF files already. But I'm also using EXPORT_GRAPHIC@ for the other file formats and it would have been nice and easier if the emf type export would work.

Regards, Detlef
Back to top
View user's profile Send private message Visit poster's website
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Wed Mar 13, 2013 11:53 am    Post subject: Reply with quote

Sorry, the function is named of cause EXPORT_IMAGE@ (not EXPORT_GRAPHIC@).
Back to top
View user's profile Send private message Visit poster's website
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Wed Mar 13, 2013 11:54 am    Post subject: Reply with quote

Paul,

what do you think about my suggestion for the support of file type png?

Detlef
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Mar 20, 2013 5:57 pm    Post subject: Reply with quote

I have had a brief look at export_graphics@.

Writing to a file requires an open metafile. A quick and nasty way to get some output is illustrated here...

Code:
    winapp
    program gr3
      integer ctrl,i,h
      include <clearwin.ins>
      i=winio@('%gr[rgb_colours]%lw',320,200,ctrl)
      i=open_metafile@(0)
      call draw_filled_rectangle@(0,0,320,200,0)
      call draw_line_between@(0,0,320,200,RGB@(255,0,0))
      call draw_line_between@(0,200,320,0,RGB@(0,255,0))
      call draw_ellipse@(160,100,50,30,RGB@(0,0,255))
      i=export_image@("file.emf")
      i=close_metafile@(0)     
    end


There are at least two problems with this.
1) The background filling does not appear in the file.
2) An internal call to the Windows API function PlayEnhMetaFile fails for some unknown reason.

If you can manage without the background and can tolerate the error code then the result may be useful in some situations.

In theory there is support for bmp, pcx, emf, gif and jpg files.
I can not see anything for png files and I have no idea how much work this would involve.
Back to top
View user's profile Send private message AIM Address
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Wed Mar 20, 2013 6:40 pm    Post subject: Reply with quote

Paul,

I will check your proposal for generating metafiles.

The Portable Network Graphics png is a modern replacement for the gif format.

More information you can find in Wikipedia:

http://en.wikipedia.org/wiki/Portable_Network_Graphics

Maybe you can add this feature for the next release?

Regards,

Detlef
Back to top
View user's profile Send private message Visit poster's website
JohnCampbell



Joined: 16 Feb 2006
Posts: 2615
Location: Sydney

PostPosted: Thu Mar 21, 2013 12:29 am    Post subject: Reply with quote

The main improvement from .gif to .png is the improved colour palette.
Robert has helped me with trying to adapt the .gif 256 colour pallette.

A much better solution would be a .png format.
I would expect that implementation of a .png file format is not a trivial exercise.
It would be a very welcome addition. If someone wants to try, by first exporting the graphics image to a DIB_Block, it can be supplied as a utility outside clearwin+.

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


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

PostPosted: Thu Mar 21, 2013 8:26 am    Post subject: Reply with quote

I have had an initial look at what would be required to export to a .png file and it looks quite hopeful.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Wed Mar 27, 2013 6:34 pm    Post subject: Reply with quote

I have fixed two problems regarding export_image@ for .emf files.

The background is now drawn and a false error code has been suppressed.

I have uploaded a beta version of salflibc.dll to http://www.silverfrost.com/beta/salflibc.exe

This is a self-extracting archive and this DLL supersedes the latest release.
Back to top
View user's profile Send private message AIM Address
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Thu Mar 28, 2013 9:54 am    Post subject: Reply with quote

It's working fine now! Thanks for your help!
Back to top
View user's profile Send private message Visit poster's website
jalih



Joined: 30 Jul 2012
Posts: 196

PostPosted: Fri Mar 29, 2013 1:56 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
I have had an initial look at what would be required to export to a .png file and it looks quite hopeful.

How about using GDI+ for this one?

I guess, you just need these functions:

GdiplusStartup()
GdipCreateBitmapFromGdiDib()
GdipSaveImageToFile()
GdipDisposeImage()
GdiplusShutdown()

You will also need this info:
image/png CLSID : {557cf406-1a04-11d3-9a73-0000f81ef32e}

If you or someone else provides a little information, how ClearWin+ handles DIB's, then I can probably post something working...
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 -> Support All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
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