Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def infozettelAll
- users = User.find_all()
- zettel, faktor = createInfMain
- for user in users
- createInfDetail user, faktor, user.nickname+".jpg", zettel
- puts Time.new
- end
- end
- #====from here: not realy important
- def createInfDetail user, faktor, filename, img
- text = Magick::Draw.new
- text.font_family = 'Arial'
- text.pointsize = 3.5*faktor
- text.font_weight = Magick::NormalWeight
- event = User.find_by_sql("select * from event")
- ips = user.ip
- ersteIp=ips[0]
- if user.ip.length == 1
- text.font_weight = Magick::BoldWeight
- text.annotate(img, 1,1,160*faktor,183*faktor,"Deine IP:")
- text.font_weight = Magick::NormalWeight
- else
- text.font_weight = Magick::BoldWeight
- text.annotate(img, 1,1,160*faktor,183*faktor,"Deine IP's:")
- text.font_weight = Magick::NormalWeight
- end
- count = 0
- for ip in ips do
- text.annotate(img, 1,1,160*faktor,190*faktor+count*3.5*faktor,ip.ip)
- count += 1
- end
- text.font_weight = Magick::BoldWeight
- text.annotate(img, 1,1,60*faktor,121*faktor, ersteIp.ip)
- text.font_weight = Magick::NormalWeight
- img.write("public/images/generate/fertig/"+filename)
- end
Add Comment
Please, Sign In to add comment