B4A Library BitmapExtended Library

Discussion in 'Additional libraries, classes and official updates' started by XverhelstX, Sep 24, 2011.

  1. XverhelstX

    XverhelstX Well-Known Member Licensed User

    Hey,

    Let's give Basic4Android a boost with a new library: BitmapExtended.
    With BitmapExtended, you can do a lot more with your bitmaps:

    - Resizing, Scaling, Skewing and translating.
    - compressing
    - createScaledbitmap
    - erasing colours
    - get density
    - change pixels
    - Different ways to create bitmaps
    - and a lot more!

    Everything is explained in the library.
    A sample is delivered.

    Cheerz,

    Tomas
     

    Attached Files:

  2. Jim

    Jim Member Licensed User

    Has anyone used this lib? Without downloading, I'm curious to know what other ways to create bitmaps it provides.
     
  3. derez

    derez Expert Licensed User

    Thank you Tomas for this contribution, I'm going to try it on some apps, seems promising :)
     
  4. derez

    derez Expert Licensed User

    I guess I miss something here:
    When I use createbitmap, the object is a bitmap, how can I get its width and height ?
    The creating methods all oprate on bitmaps. I would like to have one that create a bitmap out of part of abitmap file directly, without having to load it first to a bitmap (like in jpeg library, which is slow).
     
  5. agraham

    agraham Expert Licensed User

    @Thomas - I don't know if you are doing it on purpose for some reason but all your libraries include the Java source code in the jar which unnecessarily bloats them. You only need to export the generated class files to the jar.
     
  6. XverhelstX

    XverhelstX Well-Known Member Licensed User

    mhmm, what do you exactly mean?
    I thought I did it always on the correct way.
    By doing the following in Eclipse:

    1) File -> Export
    2) Jar File
    3) At the left screen I cross the box next to my project name and at the right side .project and .classpath is automatically checked.
    4) I save it to *filepath*/$libraryname*.jar

    and I press on Finish.

    @Derez. Isn't getHeight and getWidth included?
    I should have extracted most of the information here:
    Bitmap | Android Developers

    Tomas
     
  7. agraham

    agraham Expert Licensed User

    Look at the four checkboxes below the left screen. You only need to select the top one "Export generated class files and resources".
     
  8. XverhelstX

    XverhelstX Well-Known Member Licensed User

    Oh I see.
    Will this solve any errors or something?

    Thanks a lot!

    Tomas
     
  9. agraham

    agraham Expert Licensed User

    No. It will just save space in the jars and so in every apk that includes the jars and so save memory space on the device.
     
  10. ozgureffe

    ozgureffe Member Licensed User

    Hi, and thank you for this library..
    I wonder if this library will help us to work with large sized images? Will it be possible to load some part of any image file without loading all bitmap data and touching the Memory Limits?

    And there is no explanatory samples with this library. Will you add any sample similar with Agraham's JPEG lib?
     
    Last edited: Oct 3, 2011
  11. derez

    derez Expert Licensed User

    getwidth(bitmap) returns the width of the argument bitmap. I want to get the width of the bitmap that was created using createbitmap#, and it doesn't make sense to have to use bme.getwidth(bme) instead of bme.width. this property should be inherited from the simple bitmap.

    Thanks.
     
  12. agraham

    agraham Expert Licensed User

    They are the same. This library is very simplistic in that it doesn't extend Bitmap nor does it own and manipulate an internal bitmap, it merely operates on whatever Bitmaps are passed to it so you don't need multiple BitmapExtended objects as they do not represent individual bitmaps. One instance is all you need in an activity.

    There really is no point to having getWidth and getHeight in the library as all it does is return the width and height of the Bitmap passed to it which is a bit of a no-operation really. This library would have been better written to extend the normal Bitmap object or recreate it entirely as a proper Basic4android object.
     
  13. mkvidyashankar

    mkvidyashankar Active Member Licensed User

    In the sample there is nothing about the Library except initialization. If it has more sample codes it would be much useful to use this library. Dont mistake me this is only suggestion. I am struggling to get it implemented in my app.
     
  14. RadCoder

    RadCoder Member Licensed User

    so far so good

    rotatebitmap is a lifesaver, had artefacts with canvas drawrotatedbitmap. Burned hours couldn't fix... tried your lib first go boom. You the man...
     
  15. RadCoder

    RadCoder Member Licensed User

    Bug found with RotateBitmap

    using rotate bitmap, the output bitmap always varies in size based on the degree of the rotation. For example if a bitmap is 50x50 and you apply rotatebitmap, the resulting rotated bitmap might be 53x53 depending on the degree applied. Could someone confirm my findings. If possible I could review the java source and correct

    Thanks again XverhelstX for the lib
     
  16. RadCoder

    RadCoder Member Licensed User

  17. BarrySumpter

    BarrySumpter Active Member Licensed User

    Brilliant!

    15 mins and I'm rotating!

    Thank you!

    This lib makes it so easy!

    :sign0098::sign0188:
     
  18. BarrySumpter

    BarrySumpter Active Member Licensed User

    Bummer!

    Anyone found a work around yet?

    Or maybe its been fixed in a later version of android?
     
  19. frapel

    frapel Active Member Licensed User

    I don't understand permissions required...

    I think this lib is very useful and powerful and I tried to use it in a project of mines but...

    ...I don't understand why it adds in the manifest the following permissions requirement:

    android.permission.BIND_WALLPAPER
    android.permission.SET_WALLPAPER


    Really I can't find/imagine any primitive (there is no wallpapers management) in the lib needing those... :sign0163:
     
  20. frapel

    frapel Active Member Licensed User

    :sign0163:
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice