Am 18.01.2005 um 22:13 schrieb Stefan Sicurella:
Ich möchte ein Bild passend (also nicht verzerrt) in ein Canvas
skalieren.
was mir fehlt ist faktorx und faktory, egal wie ich die berechne passt
es nicht
faktor=min(canvas1.width/pic.width, canvas1.height/pic.height)
canvas1.graphics.drawPicture
pic,0,0,pic.width*faktor,pic.height*faktor,0,0,pic.width,pic.height
aus dem Kopf...
Außerdem stürzt bei mir RB ab bei folgendem Code:
canvas1.backdrop.graphics.drawPicture
pic,0,0,canvas1.width/faktorx,canvas1.height/
faktory,0,0,pic.width,pic.height
Keine Ahnung. Vielleicht kann man in das Graphics-Objekt das Backdrop
nichts reinmalen. Evtl. geht nur canvas1.backdrop=mypicture ??
Grüße,
Andreas Bernhardt
|