Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User slinx's Avatar
    Join Date
    Dec 2009
    Posts
    334
    I have checked and used CBitmapScaler for scaling bitmaps to larger size. But it provides scaling method asynchronous ways. For my use case, I don't need scaling asynchronous way. So What are the other ways of scaling bitmaps synchronous way? Is there any example available for basic image processing in Symbian C++, what are the available api for that? Thanks

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,664
    Can you tell me what is teh use case you need the scaling for ? for example can you simply load the image into right size already, or maybe if it is for showing, you could simply play with the source & target draw rects etc.

  3. #3
    Registered User slinx's Avatar
    Join Date
    Dec 2009
    Posts
    334
    Thanks symbianyucca for reply. I have 2 things to do in SampleMethod(). My requirement is to resize image synchronously
    which would be fast and gives good quality

    Code:
    void SampleMethod(CFbsBitmap* aBitmap)  
    {
         //1. resize aBitmap to larger size  
         //2. Draw resized bitmap		
    }
    What is best available option here to resize CFbsBitmap synchronously here? Thanks

  4. #4
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,664
    do check the gc documentation, you can simply define source & target rects, effectively giving you the resizing option you are asking for.

    Also there is really no point on increasing the image size, you would simply be consuming more memory with blurry image, since there is no algorithm used there to give you any additional resolution.

  5. #5
    Registered User slinx's Avatar
    Join Date
    Dec 2009
    Posts
    334
    Thanks symbianyucca.

    do check the gc documentation, you can simply define source & target rects, effectively giving you the resizing option you are asking for.
    I have checked DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aSource), but it is indeed slow as said in documentation.

    As said in documentation:
    If the bitmap has to be scaled, consider creating another bitmap along with an CFbsBitmapDevice etc., doing DrawBitmap() once and using BitBlt() subsequently.

    Any example on how to do this?

    Also there is really no point on increasing the image size, you would simply be consuming more memory with blurry image,
    since there is no algorithm used there to give you any additional resolution.
    yes, image quality will degrade to some extent but i think there are some common image resampling algorithm like nearest neighbor or bilinear implemented there.
    I need to know using which method i can get faster image resizing. My preference is faster resize than image quality. Thanks

  6. #6
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,664
    You could check off-screen bitmap handling example from wiki for the CFbsBitmapDevice , basically the n you would simply make the target image as big as you want it to be, and then use the gc draw methods againt o draw it there, and then you would draw this in your containers draw, I would not think its any fatre than doing it directly in the container draw, anyway, as you only have partial area you should check the target & source rects ..

  7. #7
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Synchronous-asynchronous do not really affect the speed. If you are familiar with graphics algorithms you can
    - implement a completely own variant
    - use TLinearDDA
    - check http://www.developer.nokia.com/Commu...otate-an-image (that time I did not know about TLinearDDA)

  8. #8
    Registered User slinx's Avatar
    Join Date
    Dec 2009
    Posts
    334
    Thanks wizard_hu_ for your reply.

    Synchronous-asynchronous do not really affect the speed.
    yes I agree.. only overhead of using asynchronous method in synchronous way.

    If you are familiar with graphics algorithms you can. If you are familiar with graphics algorithms you can
    - implement a completely own variant
    - use TLinearDDA
    - check http://www.developer.nokia.com/Commu...otate-an-image (that time I did not know about TLinearDDA)
    I think I should try this way, one single routine to do the job. Thanks

Similar Threads

  1. QgraphicsView after scale.
    By Estel in forum Qt
    Replies: 2
    Last Post: 2010-04-20, 12:31
  2. How to scale a jpg and save it?
    By sundy10 in forum Symbian C++
    Replies: 3
    Last Post: 2010-01-13, 15:39
  3. Replies: 1
    Last Post: 2009-05-24, 03:21
  4. scale the video???
    By shadow-2005 in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2006-02-13, 10:47
  5. How to scale bitmaps ?
    By yogesh14 in forum Symbian C++
    Replies: 1
    Last Post: 2005-10-03, 05:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved