Archive for May, 2009

Tons of image formats for Smart Fpg Editor (at no additional cost :))

May 23, 2009

One of the depences of Smart Fpg Editor is FreeImage library. Until now, it was only used for decoding PNG files but the possibilities for using it for other purposes were still big.

So these days I’ve been writing a class that encapsulates some of the functions that this library provides. I’m doing this mainly because it will allow me to replace the usage of GDI+, which I had been using because standar GDI required a lot of code to deal with 32bpp bitmaps containing alpha channels.

However, I also decided to take advantage of the possibilities that the library offered to load a wide range of image formats, so now Smart Fpg Editor is available to load formats such as “GIF”, “PCX”, “PSD”, “BMP”, “JPEG”, among others. Other very rare formats are also available “XBM”, “WBMP”, … but I’m considering not including them as I see it unlikely that someone uses this kind of formats… even though that the required code to add support is minimal. We will see.

Advertisements

Map Viewer, Smart Fpg Editor

May 14, 2009

Some days ago I wrote about the non-graphical control point editor for Smar Fpg Editor. Following the features list intended for version 1, it was time to go for the Map Viewer / Editor.

This three points summarize the basic functionality for the map viewer:

  • View the graphics of the FPG in it’s real size and scaled.
  • Edit the description of the graphic
  • Edit graphically the control points of the graphic

This three features will be working before next release. Some other characteristics will be added in future versions, such as copying the map to clipboard & drag and drop support.

Here there is an screenshot of the Viewer:

Map Viewer

Map Viewer

The drawing is quite fast, even with big pictures :), and there is non apreciable flickering when scrolling (at least in my computer, and it’s quite old).

One good thing is that I’ve been able to use the knoweldedge I got when writing the Map Viewer for Flamebird MX and the performance is a great deal higher than it was on it. The look is also more professional, and the behaviour is the expected.

By the way, if you wonder what is it the graphic shown in the viewer, is an sketch of an Underground Thermal Energy Storage, but let’s leave the explaination for another moment :P…

I’ll keep you informed with the advances on it :).

Darío

Control Point Editor, Smart Fpg Editor

May 9, 2009

Time has gone by and nothing has been updated on this site, however development of Smart Fpg Editor has continued (slowly) during this time. Two major changes have taken place:

  • Splitting of the project in several modules (Active X components). Addition of new modules
  • Implementation of an “advanced” control point editor (non graphical

The splitting in several submodules responds mainly to flexibility and reusability reasons, which may not be of much concern to the end user and therefore it will not be explained here. At any case, documentation, when available (and it is already being written), will include these relevant desing notes for who plan to go deeper into the program source code.

It is, however, worth to have a look at the new control point editor and its characteristics. The editor is not a graphical control point editor, but it provides some interesting features that so far, it is not possible to find in any other editor. The complete list of features is listed below:

  • Set / Remove control points
  • 4 different modes of setting control points
    • Append mode: adds control points at the end of the CP list
    • Insertion mode: inserts a control point in the position of an existing one and moves the existing one, and the following ones one position
    • Completion-insertion mode: inserts a control point in the inmediate subsequent position of an existing one. Only if the position where the new CP is to be inserted is not free, the following control points will be displaced one position forward
    • Manual mode: allows specifying manually the position where the control point is to be inserted
  • Possibility of writing formulas as coordinates, such as “WIDTH / 2”
  • Multiple graphic edition mode, meaning that if we have several graphics selected, a set of control points can be applied to all of them at the same time

These kind of features are the ones I have sometimes missed when working with FPGs in other programs and is for that reason that I decided to include them here.

In conformity with one of the main project goals usability has been kept in mind in every aspect of the control point editor (the editor does what the user expects it to do). This may be difficult to understand here but will certainly be appreciated when working with the editor :).

A capture of the control point editor is shown below:

Control Point Editor

Control Point Editor

Some important things remain to be done before the next release. The first one will be to eliminate totally the dependence of the GDI+ library, and separate the rendering functions into a new module. By eliminating GDI+ library dependence, the program will likely run better on systems different from Win-Xp and above (probably compatibility with Wine in Linux will also increase). The new module will depend on the FreeImage library, but this library is already being used to give support to PNGs graphics, so no new dependences will be added.