How to create a new Graphic class to give suport for a new format file extenxion lazarus / 39-Graphics ---------------------------------------------------------------------- dcelso · 2013-02-25 06:53 Hello to all, anybody know How to create a new Graphic class to give suport for a new format file extension to TPicture? My custom format file is very similar to (but simpler than) TBitmap,  with more custom image information. I tried extend TBitmap class, overrriding the loadfromfile,loadfromstream,savetofile,savetostream and getfilextension methods. But this not seems enough. TPicture and TImage still continues withot can load my custom format image file. Thanks to all. ---------------------------------------------------------------------- taazz · 2013-02-25 08:39 after you have extended the tbitmap class you need to register your class with the internal file format mechanism calling the RegisterFileFormat function. Still this is not enough to see the results inside your IDE, you need to create a new package with your extra class and the call to registerfileformat and install it in the ide by rebuilding it. then you will see the new format in your IDE. ---------------------------------------------------------------------- dcelso · 2013-02-26 12:55 Thanks, Now to use in my projects i need put the call of this function  on create of my form.   TPicture.RegisterFileFormat('map','DIV MAPs',TMAPGraphic);    But, there is another method to do it automatically?, I have TMAPGraphic in another  .pas file. ---------------------------------------------------------------------- taazz · 2013-02-26 13:26 no not automatically, if you want to make sure it is always called even if you forget to call it your self, call it from the units initialization section eg Unit MapGraphic; interface ........ implementation ....... initialization  TPicture.RegisterFileFormat('map','DIV MAPs',TMAPGraphic);    end.