← Back to team overview

kicad-developers team mailing list archive

Re: whow to add new images to the project? any policy?

 

Hi Jean-Pierre,
I was in fact looking to add textures images (not icons) to 3d-viewer, the 32x32 was just an example of small image. (I am now using 64x64)

I was thinking it was something difficult as you describe, but I found that in some parts of the project you are using XPM files to embedded in the source code. I found also GIMP capable of read and export to XPM format.
So I create a new folder images and put the XPM ("small" :) ) files there and in the source.cpp I am #include "images/the_file.xmp"
Because this textures are not vectorial images, it must be handle in some raw pixel format directly.

Hope that it is alright.

Thanks for the explanation about the svg icon process, so I know when If I need it.

Mario Luzeiro
________________________________________
From: jp charras [jp.charras@xxxxxxxxxx]
Sent: 24 July 2014 11:18
To: Mário Luzeiro; kicad-developers@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Kicad-developers] whow to add new images to the project? any policy?

Le 19/07/2014 19:36, Mário Luzeiro a écrit :
> As part of my contribution to kicad source code, I would like to add a new image ex: 32x32 pixels.
> Lets say I want to use a image (png) in source code.
> Are there any policies to use / add new images to project?
> I saw what it looks like to use .cpp files to store the raw data of images. How can I add and convert new images?
> What functions can I use to read it?
>
> Thanks!
> MRL


I am guessing you want to create new icons.

All icons are vectored .svg images, (however most are optimized for a
26x26 resolution).
(we are using inkscape to build//edit/convert them).

they are converted to .cpp (from a temporary .png file) by the kicad
building process if you are using the option -DMAINTAIN_PNGS=ON.

You can find more info in bitmaps_png/CMakeLists.txt

--
Jean-Pierre CHARRAS

Follow ups

References