This library Resize a picture ( Height / Width ) and you can save the same in jpeg or png.
In this Version ( 1.1 ) this resize is possible for files on local (Ex. DireRoorExternal ) and remote ( Ex. http://www.example.com/test.jpg ), plus you can use the parameter "Ratio"
ResizePicture
Version: 1.1
ResizePicture
Author: DevilApp
Version: 1.1
Code Example:
In this Version ( 1.1 ) this resize is possible for files on local (Ex. DireRoorExternal ) and remote ( Ex. http://www.example.com/test.jpg ), plus you can use the parameter "Ratio"
ResizePicture
Version: 1.1
ResizePicture
Author: DevilApp
Version: 1.1
- ResizePicture
Methods:- resize (pathSource As String, imgSource As String, w As Int, h As Int, pathDestiny As String, imgDestiny As String, format As String, Ratio As String)
Resize Image
pathSource = Path where is original Image
imgSource = Name Image original
w = Width
h = Height
pathDestiny = Path where you want put new Image
imgDestiny = Name Image new
format = "png" or "jpeg"
ratio = "yes" if you want maintaing its aspect ratio, otherwise "no" and resize your w and h
Example:<code>
Dim pic As ResizePicture
File.Copy(File.DirAssets, "test.jpg",File.DirRootExternal,"test.jpg")
Dim nomepath As String = File.DirRootExternal
pic.resize( nomepath, "test.jpg", 600, 400, nomepath, "vedi","jpeg", "yes")</code> - resizeUrl (pathSourceUrl As String, imgSource As String, w As Int, h As Int, pathDestiny As String, imgDestiny As String, format As String, Ratio As String)
Resize and Copy Image from URL to Destiny - Joke NJDude
pathSourceUrl = URL where is original Image
imgSource = Name Image original
w = Width
h = Height
pathDestiny = Path where you want put new Image
imgDestiny = Name Image new
format = "png" or "jpeg"
ratio = "yes" if you want maintaing its aspect ratio, otherwise "no" and resize your w and h
Example:<code>
Dim pic As ResizePicture
Dim nomepath As String = File.DirRootExternal
pic.resizeUrl("http://devil-app.eu/immagini_mie/","test.jpg", 250,150, File.DirRootExternal,"vedi","jpeg","yes")</code>
- android.permission.INTERNET
- resize (pathSource As String, imgSource As String, w As Int, h As Int, pathDestiny As String, imgDestiny As String, format As String, Ratio As String)
Code Example:
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim pic As ResizePicture
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
File.Copy(File.DirAssets, "test.jpg",File.DirRootExternal,"test.jpg")
Dim nomepath As String = File.DirRootExternal
'This Local Picture
pic.resize( nomepath, "test.jpg", 300, 400, nomepath, "vedi1","jpeg","yes")
'This Remote Picture
'pic.ResizeUrl("http://devil-app.eu/immagini_mie/","test.jpg", 300,400, File.DirRootExternal,"vedi","jpeg", "yes")
End Sub
Attachments
Last edited: