realbasic-nug.de
[Top] [All Lists]

Re: Bild passend in Canvas

To: REALbasic NUG German <realbasic-nug dot de at lists dot realsoftware dot com>
Subject: Re: Bild passend in Canvas
From: Stefan Sicurella <sicurella at onlymac dot de>
Date: Tue, 18 Jan 2005 22:31:49 +0100
Delivered-to: realbasic-nug dot de at lists dot realsoftware dot com
References: <D504BE0A-6995-11D9-ADCD-000A9596D8EC at onlymac dot de> <4EB44D8C-6997-11D9-9ED4-003065EB3D78 at andreasbe dot de>
Hi,

super, danke, so klappt es.

Ich muss das Bild als Backdrop rein malen sonst wird es bei jeder Aktion gelöscht...

Gruß

Stefan

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



<Prev in Thread] Current Thread [Next in Thread>