CN112905277A - 一种智能显示终端大图加载方法 - Google Patents
一种智能显示终端大图加载方法 Download PDFInfo
- Publication number
- CN112905277A CN112905277A CN202110094361.7A CN202110094361A CN112905277A CN 112905277 A CN112905277 A CN 112905277A CN 202110094361 A CN202110094361 A CN 202110094361A CN 112905277 A CN112905277 A CN 112905277A
- Authority
- CN
- China
- Prior art keywords
- picture
- screen
- sampling rate
- partitioned
- region
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000011068 loading method Methods 0.000 title claims abstract description 17
- 238000005070 sampling Methods 0.000 claims abstract description 20
- 230000000903 blocking effect Effects 0.000 claims abstract description 6
- 238000000638 solvent extraction Methods 0.000 claims abstract description 4
- 238000000034 method Methods 0.000 claims description 8
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 230000003321 amplification Effects 0.000 claims description 2
- 239000011159 matrix material Substances 0.000 claims description 2
- 238000003199 nucleic acid amplification method Methods 0.000 claims description 2
- 230000009467 reduction Effects 0.000 claims description 2
- 230000008859 change Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002265 prevention Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04845—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
- G06F3/0488—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Controls And Circuits For Display Device (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
本发明公开了一种智能显示终端大图加载方法,包括以下步骤:a、图片分块处理:包括计算采样率和根据采样率对图片进行分块,其中采样率根据屏幕显示图片的缩放率来计算,采样率确定下来之后,将图片划分为若干个区域图块;b、区域图块显示:当需要显示时,加载对应的区域图块进行绘制,绘制包括底图绘制和清晰图绘制,底图是一张缩略图,按照缩放率进行放大或缩小之后绘制在屏幕指定区域,当清晰图获取到之后再按照指定区域一张张绘制到屏幕上,覆盖底图。本发明具有消耗内存小,可以避免软件崩溃,而且加载速度快,同时又能看清图片细节的优点。
Description
技术领域
本发明涉及图像数据处理技术领域,特别是涉及一种智能显示终端大图加载方法。
背景技术
由于智能显示终端内存较小,当加载一张屏幕分辨率几十倍大小的图片时,一次性加载进内存会引发oom(out of memory存储超载)异常,导致软件崩溃。而按照现行技术加载的缩略图会影响用户观看,看不清细节部分。
发明内容
本发明的目的是克服上述背景技术中不足,提出一种智能显示终端大图加载方法,用以解决内存消耗大导致的软件崩溃、用户观看效果差的技术问题。
为达此目的,本发明采用的技术方案是:
一种智能显示终端大图加载方法,包括以下步骤:
a、图片分块处理:包括计算采样率和根据采样率对图片进行分块,其中采样率根据屏幕显示图片的缩放率来计算,采样率确定下来之后,将图片划分为若干个区域图块;
b、区域图块显示:当需要显示时,加载对应的区域图块进行绘制,绘制包括底图绘制和清晰图绘制,底图是一张缩略图,按照缩放率进行放大或缩小之后绘制在屏幕指定区域,当清晰图获取到之后再按照指定区域一张张绘制到屏幕上,覆盖底图。
本发明的有益效果如下:本发明通过图片分块加载,底图和清晰图分层绘制,而底图只是一张缩略图,因此本发明具有消耗内存小,不会出现内存超载,可以避免软件崩溃,而且加载速度快,同时又能看清图片细节的优点。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示例性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。
图1是本发明实施例的流程图。
具体实施方式
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示例性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。
如图1,一种智能显示终端大图加载方法,包括以下步骤:
a、图片分块处理:包括计算采样率和根据采样率对图片进行分块,其中采样率根据屏幕显示图片的缩放率来计算,采样率确定下来之后,将图片划分为若干个区域图块;
b、区域图块显示:当需要显示时,加载对应的区域图块进行绘制,绘制包括底图绘制和清晰图绘制,底图是一张缩略图,按照缩放率进行放大或缩小之后绘制在屏幕指定区域,当更清晰的图片还没加载出来之前时,用户还是可以看到模糊图的,不会出现屏幕黑屏和部分空白的现象,当清晰图获取到之后再按照指定区域一张张绘制到屏幕上,覆盖底图。
在本发明实施例中,底图是按下述方式确定的:
首次加载时,为了能让图片显示完全,需要取高宽缩放比更小的缩放率,因此根据当前的屏幕大小和图片大小算出高度和宽度的缩放比例Scale= ,其中bh为图片高度, bw为图片宽度, h为屏幕高度, w为屏幕宽度;
将根据该缩放比例处理后的图片缓存到内存中作为后面绘制的底图。
在本发明实施例中,对图片进行分块时,由于分块之后的图片需要进行缓存,旋转之后,屏幕上显示的图片高宽会发生变化,假如要对图片进行复用,必须使分块内容旋转之后高宽不变。所以对图片进行正方形分块,正方形在旋转之后高宽相等。
屏幕高度为h,屏幕宽度为w,取高宽的最小值为正方形的边,正方形分块区域计算公式为:
在本发明实施例中,对获取到的分块图按照采样率分组进行缓存,不同的采样率对应不同的清晰度,这样便于同一清晰度、同一块区域的图片可以复用。
在本发明实施例中,还包括手势处理:
通过手势判断当前操作为放大、缩小、旋转、移动时,底图做缩放和移动处理显示到屏幕上,同时获取屏幕上对应图片的区域,对区域进行分块,然后在缓存中获取相应的分块图片,假如有缓存好的分块图片则获取并直接绘制到屏幕相应区域,没有获取到缓存则根据分块区域采用分块解码方法获取对应图块。
其中平移是一个触摸点在屏幕上移动,缩放是两个触摸点在屏幕上移动,且两个触摸点的距离不断变化,旋转是两个触摸点在屏幕上移动,且两个触摸点中心点位置不变,距离不变。
在本发明实施例中,当没有旋转时,屏幕上对应的图片区域不需要转换,若有旋转,则需通过矩阵转换重新确定图片显示的位置和方向。
图片旋转处理是当对图片进行旋转时,获取到的图片方向和实际需要展示的方向不同,这时需要对图片显示的位置和图片的方向进行变换,确保显示到屏幕上的图片和用户在屏幕上操作的手势吻合。首先得到需要转换的区域的左上右下的坐标值分别为left,top,right,bottom,图片高度为height,图片宽度为width。当旋转角度为90度时,转换公式为:
当旋转角度为180度时,旋转公式为:
当旋转角度为270度时,转换公式为:
本发明实施例适用于智能显示终端,如智能手机、智能电视等产品。这些产品内存较小,通过本发明不仅能够实现图片分块加载,降低内存消耗,还能跟随手势变化加载内容,并对内容进行缓存和释放,降低处理器的消耗,从而实现一种反应快、内存消耗低、处理器消耗低的大图加载方法,能够给用户带来良好的图片观看和交互体验。
以上给出的实施方式只是对本发明的技术方案所作的举例与详细说明,不能认定本发明只局限于所描述的实施方式。在不脱离本发明原理与构思的前提下,对本发明的技术方案进行的变化、修改与变型仍落入本发明的保护范围内。
Claims (6)
1.一种智能显示终端大图加载方法,其特征在于包括以下步骤:
a、图片分块处理:包括计算采样率和根据采样率对图片进行分块,其中采样率根据屏幕显示图片的缩放率来计算,采样率确定下来之后,将图片划分为若干个区域图块;
b、区域图块显示:当需要显示时,加载对应的区域图块进行绘制,绘制包括底图绘制和清晰图绘制,底图是一张缩略图,按照缩放率进行放大或缩小之后绘制在屏幕指定区域,当清晰图获取到之后再按照指定区域一张张绘制到屏幕上,覆盖底图。
3.根据权利要求1所述的一种智能显示终端大图加载方法,其特征在于所述的区域图块为正方形。
4.根据权利要求3所述的一种智能显示终端大图加载方法,其特征在于对获取到的分块图按照采样率分组进行缓存,不同的采样率对应不同的清晰度。
5.根据权利要求4所述的一种智能显示终端大图加载方法,其特征在于还包括手势处理:
通过手势判断当前操作为放大、缩小、旋转、移动时,底图做缩放和移动处理显示到屏幕上,同时获取屏幕上对应图片的区域,对区域进行分块,然后在缓存中获取相应的分块图片,假如有缓存好的分块图片则获取并直接绘制到屏幕相应区域,没有获取到缓存则根据分块区域采用分块解码方法获取对应图块。
6.根据权利要求5所述的一种智能显示终端大图加载方法,当没有旋转时,屏幕上对应的图片区域不需要转换,若有旋转,则需通过矩阵转换重新确定图片显示的位置和方向。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110094361.7A CN112905277A (zh) | 2021-01-25 | 2021-01-25 | 一种智能显示终端大图加载方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110094361.7A CN112905277A (zh) | 2021-01-25 | 2021-01-25 | 一种智能显示终端大图加载方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112905277A true CN112905277A (zh) | 2021-06-04 |
Family
ID=76117208
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110094361.7A Pending CN112905277A (zh) | 2021-01-25 | 2021-01-25 | 一种智能显示终端大图加载方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112905277A (zh) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104267940A (zh) * | 2014-09-17 | 2015-01-07 | 武汉狮图空间信息技术有限公司 | 一种基于cpu+gpu的地图切片的快速生成方法 |
CN106547624A (zh) * | 2016-11-04 | 2017-03-29 | 武汉斗鱼网络科技有限公司 | 基于Android的图片加载方法及装置 |
CN106681667A (zh) * | 2017-01-09 | 2017-05-17 | 北京奇虎科技有限公司 | 一种图片展示方法、装置及移动终端 |
-
2021
- 2021-01-25 CN CN202110094361.7A patent/CN112905277A/zh active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104267940A (zh) * | 2014-09-17 | 2015-01-07 | 武汉狮图空间信息技术有限公司 | 一种基于cpu+gpu的地图切片的快速生成方法 |
CN106547624A (zh) * | 2016-11-04 | 2017-03-29 | 武汉斗鱼网络科技有限公司 | 基于Android的图片加载方法及装置 |
CN106681667A (zh) * | 2017-01-09 | 2017-05-17 | 北京奇虎科技有限公司 | 一种图片展示方法、装置及移动终端 |
Non-Patent Citations (3)
Title |
---|
IFAT: ""缩放加载大图片"", 《HTTPS://WWW.CNBLOGS.COM/XUFENGYUAN/P/6066397.HTML》 * |
LIWEICAI137: ""利用内存复用,图片分块加载 进行大图片的加载"", 《HTTPS://BLOG.CSDN.NET/LIWEICAI137/ARTICLE/DETAILS/107957011》 * |
妖久: ""Android图片采样缩放功能实例代码"", 《HTTPS://WWW.JB51.NET/ARTICLE/128209.HTM》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9443348B2 (en) | Image processing apparatus, image processing method, and program | |
CN110996170B (zh) | 视频文件播放方法及相关设备 | |
US20130265311A1 (en) | Apparatus and method for improving quality of enlarged image | |
CN108876700B (zh) | 一种提升vr显示效果的方法和电路 | |
US10650592B2 (en) | Methods and apparatus for providing rotated spherical viewpoints | |
CN111225150A (zh) | 插帧处理方法及相关产品 | |
EP2252070A2 (en) | Display control program and method for controlling display capable of providing three-dimensional display | |
CN109126131B (zh) | 游戏画面显示方法、存储介质及终端 | |
CN107870703B (zh) | 图片全屏展示的方法、***及终端设备 | |
CN114175630A (zh) | 利用注视点网格渲染沉浸式视频内容的方法、***和介质 | |
CN101984651A (zh) | 图像稳定***、显示装置及稳定图像的方法 | |
CN110740309A (zh) | 一种图像显示方法、装置、电子设备及存储介质 | |
CN101162576A (zh) | 一种显示方法和装置 | |
CN112019891A (zh) | 一种多媒体内容的显示方法及装置、终端、存储介质 | |
CN110602410B (zh) | 一种图像处理方法、装置、航拍相机及存储介质 | |
CN106843467B (zh) | 一种基于位置的屏幕扩展***及其扩展方法 | |
CN112905277A (zh) | 一种智能显示终端大图加载方法 | |
WO2024055531A1 (zh) | 照度计数值识别方法、电子设备及存储介质 | |
WO2017024954A1 (zh) | 图像显示方法及装置 | |
US10860169B2 (en) | Method, apparatus or computer program for user control of access to displayed content | |
CN113938614B (zh) | 一种视频画面的缩放方法、装置、设备及存储介质 | |
CN113810755B (zh) | 全景视频预览的方法、装置、电子设备及存储介质 | |
EP2838272A1 (en) | Television cursor moving method and device | |
KR20190129982A (ko) | 전자기기 및 그 제어 방법 | |
CN113986168A (zh) | 一种图像显示方法、装置、设备及可读存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20210604 |