User Tag List

Results 1 to 6 of 6

Thread: [Android]I need to convert Bitmap to ITexture

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall CreatorInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2006
    Location
    France
    Posts
    1,236
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    [Android]I need to convert Bitmap to ITexture

    Hello,
    For my extension I have a android.graphics.Bitmap object and I need to convert it to ITexture for use GLRenderer.inst.renderImage function.
    I try to create my extends ITexture class but it don't work.

    Code:
    public class CSurface extends ITexture    {
            public CSurface(Bitmap bmp) {
                this.imageSetData(bmp);
            }
    
            @Override
            public native int texture ();
            public native void imageSetData(int [] pixels);
    
            public void imageSetData(Bitmap img)
            {
                int [] pixels = new int [img.getWidth () * img.getHeight ()];
                img.getPixels (pixels, 0, img.getWidth (), 0, 0, img.getWidth (), img.getHeight ());
                imageSetData (pixels);
            }
    
            @Override
            public native int getWidth();
            @Override
            public native int getHeight();
    
        }
    Thanks

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall CreatorInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2006
    Location
    France
    Posts
    1,236
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    I try with an other custom classe but my application crash
    Code:
    publicclassCSurfaceextendsCImage    {
            public CSurface(Bitmap img) {
                this.imageSetData(img);
            }
    
            @Override
            public void onDestroy ()
            {
                
            }
    
        }
    @Fernando I need your help

  3. #3
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,422
    Mentioned
    226 Post(s)
    Tagged
    4 Thread(s)
    mm more information is needed please

    did you check Active picture code?
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall CreatorInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2006
    Location
    France
    Posts
    1,236
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Can you send me your email ? I can share my code repository.

    Yes I checked ActivePicture but my extension create a Bitmap object with canvas for blit part of images. But when I call "GLRenderer.inst.renderImage" I need to send ITexture and I have Bitmap object.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall CreatorInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2006
    Location
    France
    Posts
    1,236
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    If I can help you to understand I have this message in debugger:
    Code:
    I/MMFRuntimeNative: No texture for 0x7fec46fa90, but can't upload as data is not in memory
        Image texture id:-1

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall CreatorInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2006
    Location
    France
    Posts
    1,236
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the multiple post.

    My issue is done, I found a solution
    Thanks...

Similar Threads

  1. How to convert my iOS app to Android ?
    By MagnetoX in forum Android Export Module 2.5
    Replies: 2
    Last Post: 20th February 2019, 11:07 PM
  2. How do I Convert an IOS App to an Android App?
    By robobent in forum Android Export Module 2.5
    Replies: 4
    Last Post: 21st December 2017, 08:07 PM
  3. bug with bitmap custom buttons on android?
    By Redsquirrel in forum Android Export Module 2.5
    Replies: 9
    Last Post: 2nd January 2016, 03:41 PM
  4. Size of Left Bitmap and Top Bitmap Picture
    By Malion in forum Install Creator and Patch Maker
    Replies: 2
    Last Post: 18th June 2010, 02:36 PM

Posting Permissions

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