Snapshot of Viewer in .GIF Format doesn't work properly

Hello to all,

I am new to OCC.
I need your help in solving one query of mine.

I am trying to save the viewer content in .gif format in Windows and it is getting saved in Windows, but the problem comes when i try to open that image.

It is not getting opened in Microsoft Office Picture Manager/ Paint/ Windows picture and fax viewer but in CorelDraw Graphics Suite X3.In fact even its preview is not available.

i am using Dump function of V3d_View class with single argument of filename with extension.

Please i need your suggestions.

Roman Lygin's picture

Hello,

Interesting ! I have just checked with the Import/Export MFC sample. The dumped gif image is opened just fine in IrfanView but when I try to open it with Paint, it fails claiming the following:

---------------------------
Paint
---------------------------
C:\temp\test.gif
Paint cannot read this file.
This is not a valid bitmap file, or its format is not currently supported.

Weird...

---
opencascade.blogspot.com - blog on Open CASCADE

Pawel's picture

Confirmed.

Works fine when I use my internet browser but doesn't work with Paint.

Pawel

Timo Roth's picture

The reason why many programs cannot open the gif is probably that it uses the original standard GIF87a. There is a newer one, GIF89a.
You can see the used format if you open the gif-file in a text editor.

See also http://en.wikipedia.org/wiki/Graphics_Interchange_Format

To save a 3D view snapshot in a custom image format, the most flexible approach is to generate a set of pixels using V3d_View::ToPixMap() method, and then saving it to the required image format using some third-party or in-house tools. For instance, a Qt-based application can do this using Qt image codecs.