Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Super Contributor GTO_India's Avatar
    Join Date
    Nov 2010
    Posts
    871
    I want to put a bitmap image at the center of the application's background(screen).


    what is the exact code to be followed.

    I want to use this code for symbian 3 mobiles like E7, c7 and s60 3rd edition mobile like E71 and E 63.

    These are the sizes for Nokia E7

    const TInt KMyIconMaxWidthL(650);
    const TInt KMyIconMaxHeightL(280);
    const TInt KMyIconYPadding(20);
    const TInt KMyIconMaxWidthP(360);
    const TInt KMyIconMaxHeightP(480);



    These are the sizes for nokia E71


    const TInt KMyIconMaxWidthL(320);
    const TInt KMyIconMaxHeightL(240);

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    How many times I need to suggest you to use dynamic sizing and not constants.

    Also this is not consultancy service, so do not ask others to design solutions and code for you. Instead, do clearly identify your problem.

    Anyway, you could read the thread where I suggested checking the size runtime, and get ideas from there.

  3. #3
    Super Contributor GTO_India's Avatar
    Join Date
    Nov 2010
    Posts
    871
    yucca give me the link to that thread plz

  4. #4
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    Please check all threads from this and last week. I'm certain there were loads of suggestions you also did not see, thus re-reading them might be beneficial.

  5. #5
    Super Contributor GTO_India's Avatar
    Join Date
    Nov 2010
    Posts
    871
    Yucca Yes I have found the thread but How to do that at runtime without giving contsants? I have one more query too I want a texted Logo but in bmp format at the center of the screen. How to draw it?

  6. #6
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    As you have found the thread, check the code examples in it, they are showing on how you get the screen size with your code..

    For the image, just check wiki for code for loading it. Then check API docs for it to see functions from the API which with you can get the pixel size of the image. Then use this size and the screen size to determine the actual position where you draw the image to get it centered.

  7. #7
    Super Contributor GTO_India's Avatar
    Join Date
    Nov 2010
    Posts
    871
    Yucca I have not found any threads with the code examples kindly give me the link to that thread again

  8. #8
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    You are confusing me now. You first say that you did find them, and then 54 minutes later you say you did not.. Anyway, simply the thing in which you do drawing is a CCoeContainer derived class, thus you could always use Rect() function to get the rectange of it, and if you check TRect API docs, you could see how you can get width & height from the object.

  9. #9
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Code:
    void CSomeContainer::Draw(const TRect &) const
    {
        CWindowGc &gc=SystemGc();
        gc.Clear();
        gc.BitBlt( Rect().Center() - TRect(iBitmap->SizeInPixels()).Center() , iBitmap);
    }
    where "CFbsBitmap *iBitmap;"
    If the bitmap is smaller than the screen, it is going to be drawn in the middle, if the bitmap is larger than the screen, a screen-sized piece from its middle is going to be drawn on the screen.
    I do not know what those constants are doing, but you can still declare them if you like, of course.

  10. #10
    Super Contributor GTO_India's Avatar
    Join Date
    Nov 2010
    Posts
    871
    wizrad where should I define or decalre CFbsBitmap *iBitmap; ?

  11. #11
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    that would be the image you loaded, the same one you would want to center... as you need to construct it outsie Draw() you should have it as a member variable of your class..

  12. #12
    Super Contributor GTO_India's Avatar
    Join Date
    Nov 2010
    Posts
    871
    Yucca I have one doubt My masked image background is bigger than the actual bitmap image background. I want it to keep at the center of the screen.

    As you told there is no need for giving sizes, Iam working on ot now. Any other changes needed for it.

  13. #13
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    I'm not getting the idea that the Mask would be bigger than the image. Can you explain it in details in a way that it would be understandable ?

    Anyway, it is really simple. You have a screen which size you can get, and you can get the image size as well. And as a programmer you should know simple math like adding, subtracting, etc. So can you stop and think about it a bit before asking any follow up questions.

  14. #14
    Super Contributor GTO_India's Avatar
    Join Date
    Nov 2010
    Posts
    871
    wizard I have defined CFbsBitmap *iBitmap in .h and tried to draw a small bitmap texted logo . bUt when I have istalled on the device and clicking on the ocn nothing is happening.


    Defined like this:

    private: // Data
    CFbsBitmap *iBitmap;

    CFbsBitmap* iBackgroundImage;
    CFbsBitmap* iBackgroundMaskImage;

    CPeriodic *iPeriodicTimer;

  15. #15
    Super Contributor GTO_India's Avatar
    Join Date
    Nov 2010
    Posts
    871
    Sorry to canfuse u yucca. My actual target is to Draw a texted logo like bitmap image on the black screen i.e background.

Page 1 of 2 12 LastLast

Similar Threads

  1. capture screen image through background exe
    By cool_ranjeet in forum Symbian C++
    Replies: 17
    Last Post: 2012-03-21, 12:21
  2. how to fit the background image to the screen size
    By amit04.kumar in forum Symbian Media (Closed)
    Replies: 6
    Last Post: 2010-09-24, 15:20
  3. Replies: 0
    Last Post: 2009-07-31, 10:18
  4. Replies: 0
    Last Post: 2004-12-01, 07:24
  5. How to center a CFbsBitmap image on the screen?
    By stopin in forum Symbian C++
    Replies: 1
    Last Post: 1970-01-01, 02:00

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