B4A Library Jpeg library

MarkoMylo

Member
Licensed User
Longtime User
I have problem when i use this library to load lot of parts of one big jpeg image (flags 100x100 from 1000x1000)

i need to create inputstream for every LoadJpegArea
for example:

In = File.OpenInput(File.DirRootExternal, "z.jpg")
bmp = jpg.LoadJpegArea(In,40,40,160,160)
In2 = File.OpenInput(File.DirRootExternal, "z.jpg")
bmp = jpg.LoadJpegArea(In2,40,40,160,160)
In3

etc etc
with every button press or imageview press or some other sub i need to open picture and to use another InputStream

this does not work:

In = File.OpenInput(File.DirRootExternal, "z.jpg")
bmp = jpg.LoadJpegArea(In,40,40,160,160)
bmp2 = jpg.LoadJpegArea(In,40,40,160,160)
iv1.SetBackgroundImage(bmp)
iv2.SetBackgroundImage(bmp2)

Same InputStream... give me some error!

PLEASE HELP!
 

Licht2002

Member
Licensed User
Longtime User
Thanks for this usefull libery.... it works great.

But ONE Question:

I capture a Bitmap from WebView -> i get a Bitmap:

' Now i store the Bitmap to Cache or Filesystem:
Dim out As OutputStream
out = File.OpenOutput(File.DirInternalCache, "picture.jpg", False)
bmp.WriteToStream(out, 100, "JPEG")
out.Close

Then i load it to "IN"
Dim In As InputStream
In = File.OpenInput(File.DirInternalCache,"picture.jpg")
bmp = jpg.LoadJpegArea(In,100,100,200,200)


Is it possible, to save the step "bmp.writeToStream" & "FileOpenInput" to handle the Bitmap directly in "jpg.Load"?

Thanks for your HELP

Sorry for my english.... i´m from Germany

Tom
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…