Android Question Create a thumbnail - missing a library reference

severika

Member
Licensed User
Hello,
I found somewhere this code :

Dim im As Image
Dim can As Canvas
im.Initialize("c:/temp/","jelly.png")' the image (150 x 150)
Dim jo As JavaObject
can.Initialize("")
jo = can
jo.RunMethod("setWidth",Array(75.0))
jo.runmethod("setHeight",Array(75.0))
can.DrawImage(im,0.0,0.0,75.0,75.0)
Dim out As OutputStream = File.OpenOutput("c:/temp/", "jellyGrab.png", True)
can.snapshot.WriteToStream(out)
out.Close


However, I receive the following error :

Error description: Unknown type: image
Are you missing a library reference?

Any clues ? Which library should I include ?

Thank you very much.
 

walterf25

Expert
Licensed User
Hello,
I found somewhere this code :

Dim im As Image
Dim can As Canvas
im.Initialize("c:/temp/","jelly.png")' the image (150 x 150)
Dim jo As JavaObject
can.Initialize("")
jo = can
jo.RunMethod("setWidth",Array(75.0))
jo.runmethod("setHeight",Array(75.0))
can.DrawImage(im,0.0,0.0,75.0,75.0)
Dim out As OutputStream = File.OpenOutput("c:/temp/", "jellyGrab.png", True)
can.snapshot.WriteToStream(out)
out.Close


However, I receive the following error :

Error description: Unknown type: image
Are you missing a library reference?

Any clues ? Which library should I include ?

Thank you very much.
Image is not a type in Basic4Android, try changing it to Bitmap instead.

Walter
 
Top