how to make a scale bar with krita

Cyrille Berger cberger at cberger.net
Thu Jun 8 18:44:40 CEST 2006


> Ok, thats a pity! There should be an option to specify the size of a drawn
> object like in photoshotp where you can make this very easily . Is
> something like that planed for the future? Or something like a plugin which
> just paints you such a thing, if you give him the dimensions an position of
> your object (in my case a scale bar).
(I don't know exactly what a scale bar is but I assume it's a rect ?)
But the following ruby script might do the trick:

x = 10
y = 20
width = 200
height = 100

require "krosskritacore"
doc = Krosskritacore::get("KritaDocument")
image = doc.getImage()
layer.beginPainting("rect painting")
painter = layer.createPainter()
somecolor = Krosskritacore::newRGBColor(100,150,200)
painter.setPaintColor( blackcolor )
painter.setBrush(  Krosskritacore::newRectBrush(1,1,0,0) )
painter.setFillStyle( 1 )
painter.setStrokeStyle( 1 )
painter.paintRect(x, y, width, height, 1.1)




-- 
--- Cyrille Berger ---


More information about the kimageshop mailing list