Code Monkey home page Code Monkey logo

circleimage's Introduction

Circle Image:

This library is developed to provide circle image implemented using extended typescript.


Download and Install:

npm install @ohos/libcircularimage --save

Details about OpenHarmony NPM environment configuration, click here.


Instructions for Use:

1. Import files and code dependencies

import {CircularImage, CircleImageModel, ClickListener} from '@ohos/libcirclularimage'

2. Initialize Model Data

model: CircleImageModel.Model = new CircleImageModel.Model();

3. Initialize the Circular Image

CircularImage({
    model: this.model,
    onClick: () => {
         prompt.showToast({
              message: 'Circular Image is clicked'
         })
    }
})

4. Call the corresponding function of Model and display the target image

updateModelForFirst() {
    this.model.reset()
    this.model.setSrcPath(this.imageSource)
    this.model.setImageWidth(this.imageWidth)
    this.model.setImageHeight(this.imageHeight)
    this.model.setImageRadius(50)
    this.model.setNeedBorder(true)
    this.model.setBorderWidth(5)
    this.model.setBorderColor('#0000FF')
}

5. Interface Description

model: CircleImageModel.Model = new CircleImageModel.Model();

Reset: model.reset()

Set Image source path: model.setSrcPath()

Set Image width: model.setImageWidth()

Set Image height: model.setImageHeight()

Set Image radius: model.setImageRadius()

Whether a border is required: model.setNeedBorder()

Set border width: model.setBorderWidth()

Set border color: model.setBorderColor()

Set the click event: model.setClickListener()


Directory Structure:

|---- ImageCircle
      |---- libcircularimage  #circle image library
            |---- src
                  |---- clickListener.ets
                  |---- CircleImageModel.ets
                  |---- circleImage.ets
      |---- entry  #Sample Code Folder
            |---- src
                  |---- main
                        |---- MainAbility
                              |---- pages 
                                    |---- index.ets  

Compatibility:

Supports OpenHarmony API version 8 and above.


Code Contribution:

If you find any problems during usage, you can submit an Issue to us. Of course, we also welcome you to send us PR. Please enjoy and participate in open source freely.


Open Source Protocol:

This project is based on Apache License 2.0 , please enjoy and participate in open source freely.

circleimage's People

Forkers

muskan35

circleimage's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.