mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
how-tos made with markdown snippet injector
This commit is contained in:
25
apps/tests/image-source.md
Normal file
25
apps/tests/image-source.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
nav-title: "image-source How-To"
|
||||
title: "How-To"
|
||||
description: "Examples for using image-source"
|
||||
---
|
||||
# Image source
|
||||
Using the image source requires the image-source module.
|
||||
<snippet id='imagesource-require'/>
|
||||
The pre-required `imageSource` module is used throughout the following code snippets.
|
||||
We also use fs module defined as follows:
|
||||
<snippet id='imagesource-require-alt'/>
|
||||
|
||||
## Loading and saving images
|
||||
### Load image using resource name
|
||||
This is similar to loading Bitmap from `R.drawable.logo` on Android or calling `[UIImage imageNamed@"logo"]` on iOS
|
||||
<snippet id='imagesource-resname'/>
|
||||
|
||||
### Load image from URL
|
||||
<snippet id='imagesource-load-url'/>
|
||||
|
||||
### Save image source to PNG or JPG file
|
||||
<snippet id='imagesource-save-to'/>
|
||||
|
||||
### Load image from a local file
|
||||
<snippet id='imagesource-load-local'/>
|
||||
Reference in New Issue
Block a user