You Are Here:

Community: Developer Discussion Boards

#1 Old canvas.blit() problem of scaling - 2008-06-28, 03:50

Join Date: Jun 2008
Posts: 12
Zamoth_bg
Offline
Registered User
Ok hear is the code, sorry it is so big. I have problems with scaling pictures and displaying them on canvas.
Here is two results I get. The number displayed in the lower left corner is the scaling factor. When it is 1 it is awfully stretched and when it is less than 1 the picture just appears in normal size. What I want is smooth scaling between sizes.
http://img105.imageshack.us/img105/9332/18825390zl1.png http://img524.imageshack.us/img524/9317/x2by5.png[/url]

http://www.box.net/shared/k1j7zfu4ok

Link to .py file. When I paste it here it loses indentation.

Thank you to anyone that tries to help me
Reply With Quote

#2 Old Re: canvas.blit() problem of scaling - 2008-06-28, 21:17

Join Date: Jun 2008
Posts: 12
Zamoth_bg
Offline
Registered User
Ok, I guess there is problem. What else would you like me to write so it is more clear what is the problem? I can include the picture if you want but you can use whatever picture you want it does not make a difference.
Reply With Quote

#3 Old Re: canvas.blit() problem of scaling - 2008-06-28, 22:02

Join Date: Jun 2005
Posts: 382
y.a.k
Offline
Regular Contributor
The "scale" parameter of blit() method isn't used to specify the scale ratio. You just set it to 1 to enable scalling.

The actual ratio is specified by the "target" and "source" parameters. Both of them can be an ((x,y),(w,h)) tuple. Since the source is ((0,0),image.size) by default, all you have to do if you want to blit the whole image is to set the target properly (and don't forget to set scale=1).
Reply With Quote

#4 Old Re: canvas.blit() problem of scaling - 2008-06-29, 13:19

Join Date: Jun 2008
Posts: 12
Zamoth_bg
Offline
Registered User
Great! It works, thank you very much...
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
GIF Scaling problem in MMS stephensson General Messaging 0 2008-06-09 18:48
scaling problem Nitesh Bhardwaj Symbian Media (Graphics & Sounds) 5 2008-06-02 15:10
Problem with eglSwapBuffers and heap corruption greatape Symbian Media (Graphics & Sounds) 2 2007-05-24 04:35
netcards - Problem with opening adapter kernj Symbian Tools & SDKs 5 2007-01-10 09:56
Problem: S60 SDK for CW in PC with .NET anttij Carbide.c++ IDE and plug-ins 1 2005-02-28 12:36

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia