×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    12

    Opengl and 2d image

    hi friends,
    i'm working on 3d game.
    for now i'll tell what problems i'm facing in terms of sample cube opengl project.
    i want to draw an png image on screen, i am able to load and display png image but rect part of image covers 3d cube

    i have created UIImageVeiw class:
    void CUIImageView::ConstructL(const TDesC& afilepath)
    {
    CreateWindowL();
    iBitmap = new(ELeave) CFbsBitmap;
    iBitmapMask = new(ELeave) CFbsBitmap;
    GetPng(afilepath,iBitmap,iBitmapMask);
    hidden=false;
    TRect screenRect(TPoint(0,0),iBitmap->SizeInPixels());
    SetRect(screenRect);
    ActivateL();
    }
    and displaying image by calling:

    void CUIImageView::display(const TPoint& aPoint)
    {
    CWindowGc& gc = SystemGc();
    gc.Activate( *DrawableWindow() );
    if(!hidden){
    TRect bmpPieceRect(aPoint,iBitmap->SizeInPixels());
    gc.BitBltMasked(aPoint,iBitmap,bmpPieceRect,iBitmapMask,0);
    }
    gc.Deactivate();
    }

    i am creating object of CUIImageView in simplecube.cpp
    and calling obj->display(point) from appCycle of simplecube.cpp

    i want to see image over cube not clipped cube what can i do???

    if someone can help i can provide with code also....as i'm short of time...
    thanx in advance
    Last edited by jjaaxx44; 2010-04-14 at 10:44.

  2. #2
    Registered User
    Join Date
    Mar 2010
    Posts
    12

    Re: Opengl and 2d image

    anyone??
    please

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Opengl and 2d image

    I have not checked what BitBltMasked actually does, but if in any case it tries to read the display, it will get 0-s instead of your OpenGL rendering (the same thing you would experience when trying to capture OpenGL image with CWsScreenDevice::CopyScreenToBitmap).
    A thing you can try is converting your mask to a binary one, that might work.

  4. #4
    Registered User
    Join Date
    Mar 2010
    Posts
    12

    Re: Opengl and 2d image

    i'm not getting what ur trying to say,
    i'm just trying to draw an image over screen. on iphone and android i have done it pretty easily.
    but not on symbian.
    please if anyboby can give me project which has normal image shown on screen. without covering the box(from simple cube project).
    i.e. transpernt part image should not show anything but box.

Similar Threads

  1. How to write text in an OpenGL ES game?
    By MobileVisuals in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2009-12-10, 08:13
  2. Satio OpenGL bug?
    By frizi in forum Symbian
    Replies: 1
    Last Post: 2009-11-10, 14:26
  3. How can i use 2D OpenGL feature for image display
    By ranjeetk in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2009-05-06, 14:28
  4. Replies: 6
    Last Post: 2008-02-13, 12:30
  5. Processing images using openGL
    By miguelbl in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2007-08-02, 10:17

Posting Permissions

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