HarmonyOS NEXT Practical: Image Magnification and Reduction

Goal: Use two fingers to pinch and zoom in and out of the imageKnowledge points:
PinchGesture is used to trigger a pinch gesture, with a minimum of 2 fingers and a maximum of 5 fingers, and a minimum recognition distance of 5vp.
interface
⛶PinchGesture(value?:{fingers?:number, distance?:number})Th...

? https://www.roastdev.com/post/....harmonyos-next-pract

#news #tech #development

Favicon 
www.roastdev.com

HarmonyOS NEXT Practical: Image Magnification and Reduction

Goal: Use two fingers to pinch and zoom in and out of the imageKnowledge points:
PinchGesture is used to trigger a pinch gesture, with a minimum of 2 fingers and a maximum of 5 fingers, and a minimum recognition distance of 5vp.
interface
⛶PinchGesture(value?:{fingers?:number, distance?:number})The pinch gesture is used to trigger the pinch gesture event and has two optional parameters:
Fingers: Used to declare the minimum number of fingers required to trigger a pinch gesture, with a minimum value of 2, a maximum value of 5, and a default value of 2. The trigger gesture can have more fingers than the number of fingers, but only the fingers that fall first and have the same number as the fingers participate in the gesture calculation.
Distance: Used to declare the minimum distance that triggers the pinch gesture, in vp, with a default value of 5. Explanation: Value range: [0,+∞). When the recognition distance value is less than or equal to 0, it will be converted to the default value.
API15 adds:
isFingerCountLimited
Check the number of fingers touching the screen. If the number of fingers touching the screen is not equal to the minimum number of fingers set to trigger pinching (i.e. the fingers parameter mentioned above), the gesture will not be recognized. The gesture can only be successfully recognized when the hand index of touching the screen is equal to the minimum number of fingers set to trigger the pinch gesture, and the sliding distance meets the threshold requirement (only the two fingers that fall first participate in the gesture calculation, if one of them is lifted, the gesture recognition fails). For gestures that have been successfully recognized, changing the number of fingers touching the screen in the future will not trigger the onActionUpdate event, but it can trigger the onActionEnd event. Default value: false。event
⛶onActionStart(event:(event: GestureEvent) = void) //Pinch gesture recognition successfully callback.
onActionUpdate(event:(event: GestureEvent) = void) //Pinch gesture callback during movement.
onActionEnd(event:(event: GestureEvent) = void) //Pinch gesture recognition successful, triggering a callback when the finger is raised.
onActionCancel(event: () = void) //Pinch gesture recognition successful, triggered callback upon receiving touch cancellation event.attribute
tag: Set Pinch gesture flag to distinguish bound gestures when customizing gesture judgment.
allowedTypes: Set the event input source supported by Pinch gesture.Actual combat:ImageEnlargementReductionDemoPage
⛶@Entry
@Component
struct ImageEnlargementReductionDemoPage {
@State scaleValue: number = 1;
@State pinchValue: number = 1;
@State pinchX: number = 0;
@State pinchY: number = 0;

build() {
Stack({ alignContent: Alignment.Top }) {
Image('https://pica.zhimg.com/v2-764199c9470ff436082f35610f1f81f4_1440w.jpg')
.width('100%')
// 在组件上绑定缩放比例,可以通过修改缩放比例来实现组件的缩小或者放大
.scale({ x: this.scaleValue, y: this.scaleValue, z: 1 })
.gesture(
// 在组件上绑定2指触发的捏合手势
PinchGesture({ fingers: 2 })
.onActionStart((event: GestureEvent | undefined) = {
console.info('Pinch start');
})
// 当捏合手势触发时,可以通过回调函数获取缩放比例,从而修改组件的缩放比例
.onActionUpdate((event: GestureEvent | undefined) = {
if (event) {
this.scaleValue = this.pinchValue * event.scale;
this.pinchX = event.pinchCenterX;
this.pinchY = event.pinchCenterY;
}
})
.onActionEnd(() = {
this.pinchValue = this.scaleValue;
console.info('Pinch end');
})
)

Text('图片放大缩小Demo')
.fontColor(Color.Orange)
.fontSize(24)
}
.width('100%')
.height('100%')
}
}

Similar Posts

Similar

Revolutionizing Teamwork Skills: The Impact of Online Learning Platforms on Students

Teamwork is an essential skill set in today's collaborative work culture. Students need to master this skill not only for their academic growth but also to stay competitive in their future professional lives. Traditional classrooms have always offered numerous opportunities to work in groups. Howeve...

? https://www.roastdev.com/post/....revolutionizing-team

#news #tech #development

Favicon 
www.roastdev.com

Revolutionizing Teamwork Skills: The Impact of Online Learning Platforms on Students

Teamwork is an essential skill set in today's collaborative work culture. Students need to master this skill not only for their academic growth but also to stay competitive in their future professional lives. Traditional classrooms have always offered numerous opportunities to work in groups. However, with the ongoing digital revolution in the education sector, the focus has shifted towards online learning platforms. So, how are these digital platforms helping students to develop teamwork skills? Online learning platforms have risen astronomically in their demand in recent years. They offer flexible and personalized learning experiences to students with the help of modern technology. However, the scope of these platforms is not limited to individual learning, they also offer brilliant opportunities for teamwork and collaboration.Firstly, online learning platforms foster participation from all learners. Introverted students or those who hesitate to participate in on-site classroom discussions, find it easier to participate in digital discussions. For group projects, they work and communicate within their team via chatrooms, shared documents, and video conferences.Secondly, these platforms provide plenty of tools and technologies like shared documents, interactive whiteboards, breakout rooms, etc., helping streamline group work. Collaborative tools like Google Docs, Dropbox, Evernote ensure everyone in the team can view, share, or change the document simultaneously. Likewise, project management tools like Trello or Asana help students in managing the project effectively, and everyone knows their role, deadline and other details about the project.Thirdly, incorporating asynchronous learning solutions is another way of encouraging teamwork. In this approach, students can contribute whenever they can rather than at a fixed time, resulting in a well-thought-out response over impulsive reactions. This model respects the individual learning pace of every student and reduces the pressure linked with real-time interactions.To develop strong teamwork skills, seamless communication is crucial. Thanks to modern-day technologies such as Zoom or Microsoft Teams, online platforms can easily bridge this gap. These tools not only facilitate smooth communication but also stimulate students to learn and adopt the professional tools used in the workplace.Moreover, online learning platforms with international accessibility bring a global perspective to teamwork and collaboration. Students get the opportunity to interact, team-up with peers from different cultures and time zones, broadening their understanding of global work culture and enhancing their communication and negotiation skills.Lastly, in online courses, feedback is usually comprehensive, immediate, and continuous. Students get detailed, specific feedback on their group projects, enabling them to understand and learn from their mistakes, monitor their progress, and improve their decision-making abilities.In conclusion, online learning platforms are shaping a ‘New Age Learning Environment’, where students are experiencing the real essence of teamwork in a more comprehensive and technologically advanced way. It instills essential teamwork skills like effective communication, responsibility-sharing, conflict resolution, and decision-making among students. The familiarity with digital tools and platforms is an additional benefit that’ll prepare them for future digital workspace scenarios. As we head towards a more digitally-integrated future, the role of online learning platforms becomes even more vital in shaping our students and our professionals of tomorrow.
Similar

HarmonyOS NEXT Practical: Pop up Bottom Menu

Goal: Pull up the bottom menu to enable it to pop up and close.Knowledge points:
The half modal page (bindSheet) defaults to a non full screen pop-up interactive page in modal form, allowing some underlying parent views to be visible, helping users retain their parent view environment when interacti...

? https://www.roastdev.com/post/....harmonyos-next-pract

#news #tech #development

Favicon 
www.roastdev.com

HarmonyOS NEXT Practical: Pop up Bottom Menu

Goal: Pull up the bottom menu to enable it to pop up and close.Knowledge points:
The half modal page (bindSheet) defaults to a non full screen pop-up interactive page in modal form, allowing some underlying parent views to be visible, helping users retain their parent view environment when interacting with the half modal.
Semimodal pages are suitable for displaying simple tasks or information panels, such as personal information, text introductions, sharing panels, creating schedules, adding content, etc. If you need to display a semi modal page that may affect the parent view, semi modal supports configuring it as a non modal interaction form.
Semimodal has different morphological capabilities on devices of different widths, and developers have different morphological demands on devices of different widths. Please refer to the (preemptType) attribute. You can use bindSheet to construct semi modal transition effects, see Modal Transitions for details. For complex or lengthy user processes, it is recommended to consider alternative transition methods to replace semi modal. Such as full modal transitions and Navigation transitions.
Use constraints
When embedding a semi modal UI Extension, it is not supported to pull up semi modal/pop ups within the UI Extension again.
If there is no scenario for secondary confirmation or custom closure behavior, it is not recommended to use the shoulder Dismiss/onWilDismiss interface.
life cycle
The semi modal page provides a lifecycle function to notify users of the lifecycle status of the pop-up window. The triggering sequence of the lifecycle is as follows: onWillAppear - onAppear - onWillDisappear - onDisappear。Use nested scrolling interaction: The default nested mode for the above interaction in the semi modal is: {Forward:PARENT_FIRST,Backward:SELF_FIRST}Operation priority when sliding in the content area of the semi modal panel:
The content is at the top (handled in this state when the content cannot be scrolled)
When sliding up, prioritize expanding the panel gears upwards. If there are no gears available for expansion, scroll through the content
When sliding down, prioritize shrinking the panel gear downwards. If there is no gear available for shrinking, close the panel
The content is in the middle position (can be scrolled up and down)
When scrolling up/down, prioritize scrolling the content until the page reaches the bottom/top
The content is at the bottom position (when the content is scrollable)
When sliding up, it presents a rebound effect in the content area without switching gears
When sliding down, scroll through the content until reaching the top
Actual combat:BottomPopUpDemoPage
⛶@Entry
@Component
struct BottomPopUpDemoPage {
@State isShow: boolean = false
@State sheetHeight: number = 300;

build() {
Column({ space: 20 }) {
Text('底部菜单Demo')

Button("拉起底部菜单")
.onClick(() = {
this.isShow = true
})
.fontSize(20)
.margin(10)
.bindSheet($$this.isShow, this.buildSheet(), {
height: this.sheetHeight,
backgroundColor: '#EEEEEE',
onWillAppear: () = {
console.log("BindSheet onWillAppear.")
},
onAppear: () = {
console.log("BindSheet onAppear.")
},
onWillDisappear: () = {
console.log("BindSheet onWillDisappear.")
},
onDisappear: () = {
console.log("BindSheet onDisappear.")
}
})
}
.width('100%')
.height('100%')
}

@Builder
buildSheet() {
Column({ space: 10 }) {
Text('底部菜单栏')
Button('菜单 1')
Button('菜单 2')
Button('菜单 3')
Button("收起菜单")
.fontSize(20)
.backgroundColor(Color.Gray)
.onClick(() = {
this.isShow = false;
})
}
.width('100%')
.height('100%')
.padding({ top: 10 })
}
}
Similar

Best Practices for Optimizing Construction Budgets and Resources

Managing budgets and resources efficiently is essential for the success of any production mission. Without the right planning, initiatives can face monetary overruns, delays, and useful resource wastage, all of which could cause severe losses. A nicely optimised finances not handiest helps in fee ma...

? https://www.roastdev.com/post/....best-practices-for-o

#news #tech #development

Favicon 
www.roastdev.com

Best Practices for Optimizing Construction Budgets and Resources

Managing budgets and resources efficiently is essential for the success of any production mission. Without the right planning, initiatives can face monetary overruns, delays, and useful resource wastage, all of which could cause severe losses. A nicely optimised finances not handiest helps in fee manage however additionally guarantees that sources are allotted effectively, lowering waste and enhancing productiveness. To attain this, construction agencies need to adopt a combination of strategic financial planning, cutting-edge technology, and information-driven selection-making. Services like Construction Takeoff Services play a crucial role in this process, helping contractors accurately estimate material costs and avoid budget discrepancies. In this weblog, we can discover a number of the first-class practices for optimizing creation budgets and resources, assisting you streamline your initiatives at the same time as retaining profitability.


Establishing a Comprehensive Budget Plan
A properly-described budget is the inspiration of any a hit construction challenge. Without a clear monetary plan, sudden costs can quickly spiral out of control, main to challenge delays and monetary instability.
To create a correct and powerful price range, bear in mind the following steps:
Conduct an intensive cost evaluation earlier than starting the undertaking. This consists of estimating costs for exertions, substances, allows, devices, and different overhead fees.
Factor in contingency funds to prepare for unforeseen occasions, together with price fluctuations or delays. A true rule of thumb is to set aside at the least 10-15% of the total price range as a protection net.
Use historic records from past tasks to forecast costs and avoid common budgeting mistakes. Learning from previous monetary reviews can assist in making greater accurate predictions.
Additionally, making use of superior digital equipment can considerably enhance budget accuracy and performance. Which facilitates contractors to quickly and accurately degree substances and estimate charges before challenge execution. This carrier guarantees that budgets are set realistically, preventing financial surprises alongside the manner.


Utilizing Advanced Cost Estimation Tools
In the cutting-edge creation industry, depending completely on guide calculations and previous spreadsheets is no longer an effective approach to budgeting. Technology-pushed solutions have converted how charges are envisioned, making the system extra specific, quicker, and statistics-pushed.
Some of the most effective price estimation tools consist of:
Building information modelling (BIM)– This software permits challenge managers to create certain 3-D models in their projects, helping in value planning and identifying capacity resource wastage.
AI-powered estimating software program This equipment analyzes facts from a couple of resources to offer incredibly accurate cost predictions.
Cloud-based undertaking management systems– These answers allow real-time price range monitoring, enhancing transparency and monetary oversight.
By incorporating these technologies, creation corporations can lessen mistakes, beautify productivity, and optimize value management. Furthermore, Construction Estimating Services play a vital function in helping contractors examine and forecast their budgets more efficaciously, ensuring correct price-making plans and financial performance.


Efficient Resource Allocation Strategies
Resource control is just as crucial as economic budgeting. Even with deliberate finances, inefficient resource allocation can result in delays, accelerated charges, and fabric wastage.
To optimize aid usage, bear in mind these techniques:
Proper body of workers– Assign obligations primarily based on know-how, making sure people are engaged inside the maximum suitable roles to maximise productiveness.
Lean production strategies– Reduce useless steps in the production procedure, put off cloth wastage, and make certain streamlined workflows.
Smart inventory manipulate– Use inventory tracking software to reveal stock levels, stopping shortages or overstocking of materials.
By adopting these strategies, production companies can cut down useless fees, minimize aid wastage, and enhance universal project efficiency.


Leveraging Data Analytics for Cost Optimization
Data analytics is revolutionizing the construction industry by way of imparting actual-time insights into budget performance and aid allocation. Using statistics-pushed selection-making, assignment managers can:
Identify budget deviations early and take corrective actions.
Optimize cost forecasting using ancient undertaking records.
Improve monetary transparency through tracking expenses and revenues in actual time.
With predictive analytics, creation organizations can foresee financial dangers and alter their techniques proactively. This minimizes the probability of financial overruns and guarantees initiatives stay on course financially.


Reducing Wastage and Improving Sustainability
Sustainability is not simply an environmental difficulty—it’s also a value-saving strategy. By enforcing sustainable creation practices, corporations can significantly cut prices even as decreasing their environmental footprint.
**Ways to Reduce Construction Waste:
**Use prefabricated materials to lessen on-site waste.
Recycle and repurpose leftover substances to minimize disposal charges.
Adopt strength-efficient designs that decrease operational fees.
Sustainable constructing methods not best optimize resource use but also enhance lengthy-time period budget efficiency by means of lowering preservation charges.


Ensuring Strong Financial Oversight
Construction initiatives involve more than one stakeholder, from contractors and suppliers to customers and buyers. Having a robust monetary tracking gadget in place allows transparency and duty.
Key Financial Oversight Practices:
Regular budget evaluations– **We conduct economic audits at exceptional challenge stages to track expenses and save you from overspending.
**Fraud prevention measures– Implement strict economic controls to keep away from mismanagement and unauthorized transactions.
Outsourcing economic management- Many companies benefit from outsourced financial professionals who specialize in finance optimization and compliance.
With a robust financial oversight strategy, businesses can ensure their budgets remain on the right track and unfastened from needless monetary risks.


Regular Budget Reviews and Adjustments
Even the most well-planned budgets need periodic revisions to align with venture goals. Unexpected issues together with delivery chain disruptions, hard work shortages, or inflation, can impact fees, requiring financial modifications.:
Schedule ordinary finances and take a look at them throughout the mission lifecycle.
Adjust economic allocations based on actual-time expenditure reports.


Conclusion
Optimizing creation budgets and resources is a non-stop technique that requires careful planning, era adoption, and strategic decision-making. By implementing exceptional practices consisting of complete budgeting, virtual fee estimation, facts-driven resource allocation, and sturdy economic oversight, creation groups can enhance value performance and task profitability. By leveraging solutions like Construction Takeoff Services and Construction Estimating Services, firms can beautify their financial accuracy and aid in making plans, making sure of long-term success in an increasing number of aggressive enterprises. Efficient monetary control does not best reduce prices; however also improves productivity, sustainability, and ordinary undertaking. Start optimizing your construction budgeting techniques today to build an extra profitable and destiny-ready enterprise.