×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Super Contributor
    Join Date
    Nov 2010
    Posts
    1,204

    Cool I want to put a bitmap image at the center of the application's background(screen)

    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 Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: I want to put a bitmap image at the center of the application's background(screen

    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
    Join Date
    Nov 2010
    Posts
    1,204

    Re: I want to put a bitmap image at the center of the application's background(screen

    yucca give me the link to that thread plz

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: I want to put a bitmap image at the center of the application's background(screen

    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
    Join Date
    Nov 2010
    Posts
    1,204

    Re: I want to put a bitmap image at the center of the application's background(screen

    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 Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: I want to put a bitmap image at the center of the application's background(screen

    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
    Join Date
    Nov 2010
    Posts
    1,204

    Re: I want to put a bitmap image at the center of the application's background(screen

    Yucca I have not found any threads with the code examples kindly give me the link to that thread again

  8. #8
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: I want to put a bitmap image at the center of the application's background(screen

    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
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: I want to put a bitmap image at the center of the application's background(screen

    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
    Join Date
    Nov 2010
    Posts
    1,204

    Re: I want to put a bitmap image at the center of the application's background(screen

    wizrad where should I define or decalre CFbsBitmap *iBitmap; ?

  11. #11
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: I want to put a bitmap image at the center of the application's background(screen

    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
    Join Date
    Nov 2010
    Posts
    1,204

    Re: I want to put a bitmap image at the center of the application's background(screen

    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 Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: I want to put a bitmap image at the center of the application's background(screen

    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
    Join Date
    Nov 2010
    Posts
    1,204

    Re: I want to put a bitmap image at the center of the application's background(screen

    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
    Join Date
    Nov 2010
    Posts
    1,204

    Re: I want to put a bitmap image at the center of the application's background(screen

    Sorry to canfuse u yucca. My actual target is to Draw a texted logo like bitmap image on the black screen i.e background.

Similar Threads

  1. capture screen image through background exe
    By cool_ranjeet in forum Symbian
    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. 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
  •  
×