CN113821278B - Calling image size method, device, electronic equipment and storage medium - Google Patents

Calling image size method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113821278B
CN113821278B CN202111037693.8A CN202111037693A CN113821278B CN 113821278 B CN113821278 B CN 113821278B CN 202111037693 A CN202111037693 A CN 202111037693A CN 113821278 B CN113821278 B CN 113821278B
Authority
CN
China
Prior art keywords
image
target
determining
image size
size
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.)
Active
Application number
CN202111037693.8A
Other languages
Chinese (zh)
Other versions
CN113821278A (en
Inventor
甘振文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guahao Net Hangzhou Technology Co Ltd
Original Assignee
Guahao Net Hangzhou Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guahao Net Hangzhou Technology Co Ltd filed Critical Guahao Net Hangzhou Technology Co Ltd
Priority to CN202111037693.8A priority Critical patent/CN113821278B/en
Publication of CN113821278A publication Critical patent/CN113821278A/en
Application granted granted Critical
Publication of CN113821278B publication Critical patent/CN113821278B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method, a device, electronic equipment and a storage medium for calling image size, wherein the method comprises the following steps: when the triggering target control is detected, determining target label information in target program codes; determining a target address corresponding to the image to be inserted according to the target tag information; and determining the image size of the image to be inserted corresponding to the target address based on a preset image size acquisition plug-in, and inserting the image size into the target position. The method solves the problems of low efficiency and easy error caused by manually writing the picture size when the picture size needs to be obtained, realizes automatic obtaining of the picture size, and improves the efficiency of writing codes and the accuracy of writing the picture size.

Description

Calling image size method, device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method, a device, electronic equipment and a storage medium for calling image size.
Background
Applications now require pictures to show some content, such as: doctor's head, propaganda advertisement, icon etc. the picture is more vivid and detailed show information. When writing code, a developer needs to know the size of the picture when using the picture, and then locate the picture in place.
There are various modes for writing pictures in codes, the first is to fill out the picture address through Image tags and src attributes, and control the pattern of the pictures through style attributes; the second is to set the background picture of the element by the background-image attribute in css, and to set the size of the picture by the width and height attributes.
Both methods require the size of the picture, and the existing method is to find the picture, then look at the picture size, and finally write into the picture style.
The method needs to manually check the size of the picture and manually edit the size of the picture, is easy to occur, and if the number of the called pictures comprises a plurality of pictures, the problem of editing errors is needed, so that the technical problem that the picture cannot be correctly imported is caused.
Disclosure of Invention
The invention provides a method, a device, electronic equipment and a storage medium for calling image size, so as to realize the effect of automatically acquiring the image size.
In a first aspect, an embodiment of the present invention provides a method for calling an image size, including:
when the triggering target control is detected, determining target label information in target program codes;
determining a target address corresponding to the image to be inserted according to the target tag information;
and determining the image size of the image to be inserted corresponding to the target address based on a preset image size acquisition plug-in, and inserting the image size into the target position.
In a second aspect, an embodiment of the present invention further provides an apparatus for calling an image size, including:
the label information determining module is used for determining target label information in the target program code when the triggering target control is detected;
the target address determining module is used for determining a target address corresponding to the image to be inserted according to the target label information;
the size calling module is used for determining the image size of the image to be inserted corresponding to the target address based on a preset image size acquisition plug-in, and inserting the image size into the target position.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
Storage means for storing one or more programs,
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method of invoking image size as described in any of the embodiments of the invention.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method of invoking an image size as described in any of the embodiments of the present invention.
According to the technical scheme, when the triggering target control is detected, target label information in target program codes is determined, and a target address corresponding to an image to be inserted is determined through address information of the image to be inserted carried in the target label; determining a target address corresponding to the image to be inserted according to the target tag information, accessing the corresponding image according to the target address after determining the target address of the image to be inserted, and acquiring the size of the image acquired by the plug-in based on the preset image size; the method comprises the steps of determining the image size of an image to be inserted corresponding to a target address based on a preset image size acquisition plug-in, inserting the image size into a target position, automatically acquiring the size of the image, and writing or replacing the image size at the target position by judging whether target label information in the image to be inserted contains image size information or not. The method solves the problems of low efficiency and easy error caused by manually writing the picture size when the picture size needs to be obtained, realizes automatic obtaining of the picture size, and improves the efficiency of writing codes and the accuracy of inserting the picture size.
Drawings
In order to more clearly illustrate the technical solution of the exemplary embodiments of the present invention, a brief description is given below of the drawings required for describing the embodiments. It is obvious that the drawings presented are only drawings of some of the embodiments of the invention to be described, and not all the drawings, and that other drawings can be made according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for invoking image size according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating an implementation process of a method for calling image size according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for calling image size according to a third embodiment of the present invention.
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a schematic flow chart of a method for calling image size according to an embodiment of the present invention, where the method can be applied to any situation where an image needs to be automatically acquired from a page and the size is determined, and the method can be performed by calling an image size device, where the device can be implemented in software and/or hardware, and the hardware can be an electronic device, such as a mobile terminal or a PC.
As shown in fig. 1, the method of this embodiment includes:
s110, when the triggering target control is detected, determining target label information in target program codes.
The target control may be understood as an operation key detected by the control program code when the user inserts the picture through the program code. The target control can be a custom combined shortcut key in a computer keyboard, a control detected by using program codes in a computer interface, or a control in a display interface, wherein the control is used for determining whether to execute the technical scheme to acquire the size of the image to be inserted. The triggering mode of triggering the target control can be that the user triggers immediately after clicking the target control. The target program code can be understood as the program code for calling the image to be inserted when the image to be inserted is inserted into the target position; the target tag information may be understood as tag information displayed in the program code, that is, target tag information, in which attribute information of an image, such as a width value, a height value, address information of the image, and the like, may be carried.
It should be noted that, the insertion of the corresponding image to be inserted into the target position may be implemented by a program code written in advance. The program code may include a plurality of code lines, and each code line may perform a corresponding operation, for example, acquiring an address of an image to be inserted, acquiring a size of the image to be inserted according to the address of the image to be inserted, and the like.
Specifically, in the process of executing the program code, when the operation of triggering the target control is detected, the image tag information edited in the current program line in the program code is acquired, and the image tag information is used as target tag information, so that the acquisition address of the image to be inserted is determined according to the target tag information, and the corresponding image to be inserted is acquired based on the acquisition address.
Optionally, when the triggering target control is detected, determining target label information in the target program code includes: when the triggering target control is detected, determining the current position information of a cursor; determining an object program code corresponding to the current position information based on a preset code acquisition method; target tag information in the target program code is determined.
The cursor can be understood as a cursor generated by a position of the mouse, which can be generated when the mouse moves on the computer, and the current position information of the cursor can be understood as the current position information of the mouse in the computer interface, and the specific form of the cursor can be a display cursor or an implicit cursor. The code acquisition method can be understood as a custom code function or a program code plug-in, the designated program code can be acquired through the code acquisition method, the code acquisition method can be various, for example, the code acquisition method can be realized through the designated keywords in the program code, and when the keywords in the program code are detected, the program code associated with the keywords is acquired; the program codes in the range of the initial line can also be obtained by setting the initial line in the program codes and detecting the initial line in the program codes; or the code can be obtained by setting a class name label, and when the label is clicked, the program code related to the label is obtained. The target program code corresponding to the current position information can be understood as a code segment or code line corresponding to the current position of the marking cursor; the target tag information may be understood as image tag information carried in a target code segment or a code line and used for representing image attribute information of an image to be inserted, for example, the target tag information may represent foreground image (image) tag information and may also represent background image (background-image) tag information.
Specifically, when a user triggers a target control in a preset triggering mode, program code detection is started. The program code comprises a plurality of program code segments, for example, the program code segments corresponding to the current position information of the cursor can be included, and when the cursor moves on the computer interface, the program code segments corresponding to the current position information of the cursor can update the current position information of the cursor in the program code segments in real time according to the current position information of the cursor. In order to determine the current position information of the cursor, a code acquisition method capable of acquiring a specified program code segment is preset, and an object program code corresponding to the current position information of the cursor is determined according to the code acquisition method. Further, the target tag information may be determined based on current position information of a cursor in the target code.
S120, determining a target address corresponding to the image to be inserted according to the target label information.
The image to be inserted can be understood as an image to be acquired through the target program code and used for displaying; the target address may be understood as an address of an image to be inserted to be acquired.
Specifically, after the target program code corresponding to the current position information of the cursor is acquired based on the preset code acquisition method, target tag information in the target program code can be determined, wherein the target tag information can include address information, size information, attribute information and the like of the image to be inserted. According to the determined target tag information, target address information corresponding to the image to be inserted can be determined.
For example, the target tag information may include an src attribute, and the src attribute further includes information of an image address to be inserted, so that the image address to be inserted may be obtained from the src. The image address characterizes the absolute path or relative path of the image to be inserted, and the value of src is the url of the image to be inserted, the absolute url pointing to the other site, and the relative url pointing to the value within the site. The target label information can also contain url attribute, and the url attribute can also represent an image address, so that the image acquisition address to be inserted can also be acquired in a url mode. Here url is understood to be a resource locator, where each piece of resource information has a unique address, which is called url, and thus the destination address of the image to be inserted can be determined by url.
Optionally, the determining, according to the target tag information, a target address corresponding to the image to be inserted includes: if the target label information is consistent with the first preset label, determining a target address corresponding to the image to be inserted based on a first regular expression; and if the target label information is consistent with the second preset label, determining a target address corresponding to the image to be inserted based on a second regular expression.
The first preset label may be understood as a preset label set according to a label attribute of an image to be inserted, for example, may be a foreground image (img) attribute label; the second preset tag may be understood as a further preset tag set according to a tag attribute of the image to be inserted, and may be, for example, a background-image attribute tag. The first preset label and the second preset label are only used as attribute labels of the images to be inserted, and are used for distinguishing the display type or the image type of the images to be inserted. Regular expressions are understood as a logical formula that operates on strings (including common characters (e.g., letters between a and z) and special characters (called "meta-characters")) by forming a "regular string" of predefined specific characters, and combinations of the specific characters, which is used to express a filtering logic for the string. A regular expression is a text pattern that describes one or more strings to be matched when searching text. In this embodiment, the regular expression is mainly used to convert the acquired image address into a standard form, and further acquire a corresponding image to be inserted based on the target address in the standard form.
The first regular expression and the second regular expression in the embodiment of the invention are used for representing two different regular expression rules. Illustratively, the regular expression may be a value of the size of the alternative image or a value of the size of the write image, and the specific content of the regular expression is not specifically limited in the embodiment of the present invention.
Specifically, a first preset label, a second preset label, a first regular expression and a second regular expression are preset, and target label information is detected through target program codes. If the target label information is consistent with the first preset label, converting the acquired image address into a standard form based on the first regular expression, acquiring a corresponding image to be inserted based on the target address of the standard form, and determining a corresponding target address corresponding to the image to be inserted. If the target label information is consistent with the second preset label, converting the acquired image address into a standard form based on the second regular expression, acquiring a corresponding image to be inserted based on the target address of the standard form, and determining the target address corresponding to the image to be inserted.
S130, determining the image size of the image to be inserted corresponding to the target address based on a preset image size acquisition plug-in, and inserting the image size into the target position.
The image size obtaining plug-in is understood to be a tool capable of assisting a program to obtain the image size more conveniently, and may be specifically some software components or program codes in the form of code segments. The plug-in may be encapsulated in object program code for obtaining image size information of the image to be inserted after the obtained image to be inserted and the target address of the image to be inserted. The image size may be understood as the length and width of the image, and may be understood as the pixels of the image, and there is a conversion relationship between the length and width of the image and the pixels, so that the length and width of the image may be in units of centimeters or pixels. For example, when the image is in units of centimeters, the size of the image may be calculated according to a pixel-to-centimeter conversion relationship, for example, about 28 pixels per centimeter is 1 centimeter, but at different resolutions, the number of pixels contained per centimeter is not equal, and specifically, the calculation may be performed according to the resolution of the image using the pixel-to-centimeter conversion relationship. When the image size is in units of pixels, the image size may be determined according to the number of pixels included in the horizontal and vertical directions of the image, for example, the size of 480×800 of the image may be understood as an image consisting of 480 pixels in the horizontal direction and 800 pixels in the vertical direction. The target position can be understood as a position in the target program code where the image size information is filled out.
Specifically, in order to acquire the image size, an image size acquisition plug-in may be preset, after determining the target address corresponding to the image to be inserted, the image size of the image to be inserted corresponding to the target address may be acquired by the image size acquisition plug-in, and then the acquired image size of the image to be inserted is inserted into the target position.
Optionally, the determining, by the obtaining plug-in based on the preset image size, the image size of the image to be inserted corresponding to the target address includes: reading an image to be inserted corresponding to the target address by the plug-in based on the image size; and determining an image size corresponding to the image to be inserted based on the image size acquisition plug-in.
Specifically, after identifying the target tag information of the image to be inserted, the target address of the image to be inserted may be obtained through the target tag information, and then the image to be inserted corresponding to the target address may be read by the obtaining plug-in based on the image size, and the image size corresponding to the image to be inserted may be determined.
Optionally, the inserting the image size into the target position includes: and replacing the image size by a corresponding regular expression to write the image size at the target position.
Specifically, after determining the image size of the image to be inserted corresponding to the target address based on the image size acquisition plug-in, the image size may be processed in a regular expression manner. Firstly, determining a target address of an image to be inserted according to target label information of the image to be inserted, judging whether the target label information of the image to be inserted is consistent with a preset label, and when the target label information of the image to be inserted is consistent with the preset label information, replacing the image size through a corresponding regular expression to write the image size into a target position.
Optionally, the image size includes a length and a width of the image.
According to the technical scheme, when the triggering target control is detected, target label information in target program codes is determined, and a target address corresponding to an image to be inserted is determined through address information of the image to be inserted carried in the target label; determining a target address corresponding to the image to be inserted according to the target tag information, accessing the corresponding image according to the target address after determining the target address of the image to be inserted, and acquiring the size of the image acquired by the plug-in based on the preset image size; the method comprises the steps of determining the image size of an image to be inserted corresponding to a target address based on a preset image size acquisition plug-in, inserting the image size into a target position, automatically acquiring the size of the image, and writing or replacing the image size at the target position by judging whether target label information in the image to be inserted contains image size information or not. The method solves the problems of low efficiency and easy error caused by manually writing the picture size when the picture size needs to be obtained, realizes automatic obtaining of the picture size, and improves the efficiency of writing codes and the accuracy of inserting the picture size.
Example two
As an alternative embodiment of the foregoing embodiment, fig. 2 is a schematic diagram of a specific implementation process of a method for calling image sizes according to a second embodiment of the present invention.
In one specific example, the shortcut key may be configured with keybindings tools, such as setting the shortcut key to ctrl+o, before invoking the image size to be inserted. When a user presses a shortcut key ctrl+o in a document through a cursor, an image size insertion event is triggered, that is, the technical scheme provided by the embodiment is executed, the image size of the image to be inserted is determined, the determined image size is inserted into a target position, and the image to be inserted is inserted into a target position to be displayed. When the control of Ctrl+o is detected to be triggered by the user, the target control is considered to be triggered, and at this time, the current position information of the cursor can be obtained through a cursor position information obtaining method, for example, the current position information of the cursor can be obtained through a GetTextViewLineContainingBufferPosition plugin. Then, the object code corresponding to the current position of the cursor is acquired based on the object code acquisition method, for example, the object code corresponding to the current position of the cursor can be acquired based on ContainingTextViewLine plugins, and finally, the object tag information in the object code is determined.
The method comprises the steps that a triggering area for triggering a target control is arranged on a program code compiling interface, when a user presses a shortcut key ctrl+o in the compiling interface, code detection in a target code program is triggered, target label information in an image to be inserted is detected, and whether the target label information of the image to be inserted is a first preset label image label or a second preset label background image label is judged.
When the judging result of the target label information of the image to be inserted is a first preset label foreground image (img) label, acquiring a target address of the image to be inserted from the src attribute label through an object code program, then acquiring a plug-in based on a preset image size, converting the acquired image address into a standard form based on a first regular expression, and further acquiring a corresponding image to be inserted based on the target address of the standard form, and acquiring an attribute value of the image to be inserted, wherein the first regular expression can be expressed by "/\ bsrc \b\s = \s" ] ([ - \ '\s "]"? [ \\' \ "]"?i "). And then acquiring the width and the height of the image to be inserted based on the image size acquisition plug-in image-size, and returning the size of the image to be inserted through the image size acquisition plug-in. Finally, judging the value of the width and the height of the image to be inserted in the image attribute in the target label information of the image to be inserted, if the image attribute already contains the width and the height of the image to be inserted, replacing the original width and the original height in the image attribute by a first regular expression "/\ bsrc \b\s = \s [ \ '\" ] ([) [/' \ "]; if the image attribute does not contain the width and the height of the image to be inserted, the values of the width and the height of the image obtained by the image size obtaining plug-in are directly written into the image attribute.
When the judging result of the target label information of the image to be inserted is a second preset label background image (background-image) label, acquiring a target address of the image to be inserted from a url attribute label through a target code program, acquiring a plug-in based on a preset image size, converting the acquired image address into a standard form based on a second regular expression, and acquiring a corresponding image to be inserted based on the target address of the standard form, wherein the second regular expression can be expressed by "/" |' |\url (|\g "). And then acquiring the width and the height of the image to be inserted based on the image size acquisition plug-in image-size, and returning the size of the image to be inserted through the image size acquisition plug-in. Finally, judging the values of the width and the height of the image to be inserted in the image attribute in the target label information of the image to be inserted, and if the image attribute already contains the width and the height of the image to be inserted, replacing the original width and the original height in the image attribute by a second regular expression "/" |' |url|\ (|\)/g "; if the image attribute does not contain the width and the height of the image to be inserted, the values of the width and the height of the image obtained by the image size obtaining plug-in are directly written into the image attribute.
When the target label information of the image to be inserted does not match either the foreground image (img) label or the background image (background-image) label, the target program code ends.
According to the technical scheme, when the triggering target control is detected, target label information in target program codes is determined, and a target address corresponding to an image to be inserted is determined through address information of the image to be inserted carried in the target label; determining a target address corresponding to the image to be inserted according to the target tag information, accessing the corresponding image according to the target address after determining the target address of the image to be inserted, and acquiring the size of the image acquired by the plug-in based on the preset image size; the method comprises the steps of determining the image size of an image to be inserted corresponding to a target address based on a preset image size acquisition plug-in, inserting the image size into a target position, automatically acquiring the size of the image, and writing or replacing the image size at the target position by judging whether target label information in the image to be inserted contains image size information or not. The method solves the problems of low efficiency and easy error caused by manually writing the picture size when the picture size needs to be obtained, realizes automatic obtaining of the picture size, and improves the efficiency of writing codes and the accuracy of inserting the picture size.
Example III
Fig. 3 is a device for calling image size according to a third embodiment of the present invention, where the device includes: a tag information determination module 310, a destination address determination module 320, and a size retrieval module 330.
A tag information determination module 310, configured to determine target tag information in the target program code when the trigger target control is detected;
a target address determining module 320, configured to determine a target address corresponding to an image to be inserted according to the target tag information;
the size retrieving module 330 is configured to determine an image size of an image to be inserted corresponding to the target address based on a preset image size acquiring plug-in, and insert the image size into a target position.
According to the technical scheme, when the triggering target control is detected, target label information in target program codes is determined, and a target address corresponding to an image to be inserted is determined through address information of the image to be inserted carried in the target label; determining a target address corresponding to the image to be inserted according to the target tag information, accessing the corresponding image according to the target address after determining the target address of the image to be inserted, and acquiring the size of the image acquired by the plug-in based on the preset image size; the method comprises the steps of determining the image size of an image to be inserted corresponding to a target address based on a preset image size acquisition plug-in, inserting the image size into a target position, automatically acquiring the size of the image, and writing or replacing the image size at the target position by judging whether target label information in the image to be inserted contains image size information or not. The method solves the problems of low efficiency and easy error caused by manually writing the picture size when the picture size needs to be obtained, realizes automatic obtaining of the picture size, and improves the efficiency of writing codes and the accuracy of inserting the picture size. On the basis of any optional technical scheme in the embodiment of the present invention, optionally, the tag information determining module specifically includes:
the position determining unit is used for determining the current position information of the cursor when the trigger target control is detected;
a code determining unit that determines an object program code corresponding to the current position information based on a preset code acquisition method;
and the tag information determining unit is used for determining target tag information in the target program code.
On the basis of any optional technical scheme in the embodiment of the present invention, optionally, the target address determining module specifically includes:
A first preset tag determining unit, configured to determine, based on a first regular expression, a target address corresponding to an image to be inserted if the target tag information is consistent with the first preset tag;
And the second preset label determining unit is used for determining a target address corresponding to the image to be inserted based on a second regular expression if the target label information is consistent with the second preset label.
On the basis of any optional technical scheme in the embodiment of the present invention, optionally, the size-adjusting module specifically includes:
the image to be inserted reading unit is used for obtaining an insert to read an image to be inserted corresponding to the target address based on the image size;
an image size determining unit configured to determine an image size corresponding to the image to be inserted based on the image size acquisition plug-in.
On the basis of any optional technical scheme of the embodiment of the present invention, optionally, the size-adjusting module is configured to:
and replacing the image size by a corresponding regular expression to write the image size at the target position.
Optionally, on the basis of any optional technical solution of the embodiments of the present invention, the image size includes a length and a width of the image.
The device for calling the image size provided by the embodiment of the invention can execute the method for calling the image size provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present invention.
Example IV
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. Fig. 4 shows a block diagram of an exemplary electronic device 40 suitable for use in implementing the embodiments of the present invention. The electronic device 40 shown in fig. 4 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 4, the electronic device 40 is in the form of a general purpose computing device. Components of electronic device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, a bus 403 that connects the various system components (including the system memory 402 and the processing units 401).
Bus 403 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 40 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic device 40 and includes both volatile and non-volatile media, removable and non-removable media.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 404 and/or cache memory 405. Electronic device 40 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard drive"). Although not shown in fig. 4, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 403 through one or more data medium interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored in, for example, memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
The electronic device 40 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), one or more devices that enable a user to interact with the electronic device 40, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 40 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 411. Also, electronic device 40 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 412. As shown, network adapter 412 communicates with other modules of electronic device 40 over bus 403. It should be appreciated that although not shown in fig. 4, other hardware and/or software modules may be used in connection with electronic device 40, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 401 executes various functional applications and data processing by running programs stored in the system memory 402, for example, implements the method of calling image size provided by the embodiment of the present invention.
Example five
A fifth embodiment of the present invention also provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a method of calling image size, the method comprising:
when the triggering target control is detected, determining target label information in target program codes;
determining a target address corresponding to the image to be inserted according to the target tag information;
and determining the image size of the image to be inserted corresponding to the target address based on a preset image size acquisition plug-in, and inserting the image size into the target position.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

1. A method of invoking image size, comprising:
when the triggering target control is detected, determining target label information in target program codes;
determining a target address corresponding to the image to be inserted according to the target tag information;
Determining the image size of an image to be inserted corresponding to the target address based on a preset image size acquisition plug-in, and inserting the image size into a target position; the image size obtaining plug-in is packaged in the target program code and is used for obtaining the image size information of the image to be inserted after obtaining the image to be inserted and the target address of the image to be inserted;
Wherein, the determining, according to the target tag information, a target address corresponding to an image to be inserted includes: if the target label information is consistent with the first preset label, determining a target address corresponding to the image to be inserted based on a first regular expression; and if the target label information is consistent with the second preset label, determining a target address corresponding to the image to be inserted based on a second regular expression.
2. The method of claim 1, wherein determining target tag information in target program code when a trigger target control is detected comprises:
when the triggering target control is detected, determining the current position information of a cursor;
Determining an object program code corresponding to the current position information based on a preset code acquisition method;
target tag information in the target program code is determined.
3. The method according to claim 1, wherein the determining, based on the preset image size acquisition plug-in, an image size of the image to be inserted corresponding to the target address includes:
reading an image to be inserted corresponding to the target address by the plug-in based on the image size;
And determining an image size corresponding to the image to be inserted based on the image size acquisition plug-in.
4. The method of claim 1, wherein the inserting the image size into a target location comprises:
and replacing the image size by a corresponding regular expression to write the image size at the target position.
5. The method of claim 1, wherein the image dimensions comprise a length and a width of the image.
6. An apparatus for invoking image size, comprising:
the label information determining module is used for determining target label information in the target program code when the triggering target control is detected;
the target address determining module is used for determining a target address corresponding to the image to be inserted according to the target label information;
The size calling module is used for determining the image size of the image to be inserted corresponding to the target address based on a preset image size acquisition plug-in unit and inserting the image size into a target position; the image size obtaining plug-in is packaged in the target program code and is used for obtaining the image size information of the image to be inserted after obtaining the image to be inserted and the target address of the image to be inserted;
the target address determining module specifically includes: a first preset tag determining unit, configured to determine, based on a first regular expression, a target address corresponding to an image to be inserted if the target tag information is consistent with the first preset tag; and the second preset label determining unit is used for determining a target address corresponding to the image to be inserted based on a second regular expression if the target label information is consistent with the second preset label.
7. The apparatus of claim 6, wherein the tag information determination module comprises:
the position determining unit is used for determining the current position information of the cursor when the trigger target control is detected;
A code determining unit configured to determine an object program code corresponding to the current position information based on a code acquisition method set in advance;
and the tag information determining unit is used for determining target tag information in the target program code.
8. An electronic device, the electronic device comprising:
one or more processors;
Storage means for storing one or more programs,
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of invoking image size as recited in any of claims 1-5.
9. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the method of calling image size of any of claims 1-5.
CN202111037693.8A 2021-09-06 2021-09-06 Calling image size method, device, electronic equipment and storage medium Active CN113821278B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111037693.8A CN113821278B (en) 2021-09-06 2021-09-06 Calling image size method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111037693.8A CN113821278B (en) 2021-09-06 2021-09-06 Calling image size method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113821278A CN113821278A (en) 2021-12-21
CN113821278B true CN113821278B (en) 2024-05-03

Family

ID=78921813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111037693.8A Active CN113821278B (en) 2021-09-06 2021-09-06 Calling image size method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113821278B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2143914A1 (en) * 1994-03-04 1995-09-05 Hajime Enomoto Interactive information processing system
EP1686461A2 (en) * 2005-01-31 2006-08-02 Microsoft Corporation Method and system for a target device display simulation
CN106294413A (en) * 2015-05-25 2017-01-04 阿里巴巴集团控股有限公司 The loading method of picture and device
CN107633013A (en) * 2017-08-17 2018-01-26 广州酷狗计算机科技有限公司 Page picture generation method, device and computer-readable recording medium
CN107633066A (en) * 2017-09-21 2018-01-26 北京金山安全软件有限公司 Information display method and device, electronic equipment and storage medium
CN109343845A (en) * 2018-08-14 2019-02-15 北京奇艺世纪科技有限公司 A kind of code file generation method and device
CN109508187A (en) * 2018-10-10 2019-03-22 国网新疆电力有限公司信息通信公司 Wechat public platform video text editing device construction method and its editing machine based on HTML
JP2019197308A (en) * 2018-05-08 2019-11-14 富士通株式会社 Source code conversion program and source code conversion method
WO2020006962A1 (en) * 2018-07-03 2020-01-09 北京字节跳动网络技术有限公司 Method and device for processing picture
CN111199230A (en) * 2020-01-03 2020-05-26 腾讯科技(深圳)有限公司 Target detection method and device, electronic equipment and computer readable storage medium
CN112307408A (en) * 2020-11-24 2021-02-02 微医云(杭州)控股有限公司 Method and device for determining element information in page, electronic equipment and storage medium
CN113031938A (en) * 2021-04-25 2021-06-25 中国电子系统技术有限公司 Method and device for converting visual interface image into programming language data
CN113051514A (en) * 2021-03-26 2021-06-29 挂号网(杭州)科技有限公司 Element positioning method and device, electronic equipment and storage medium
CN113296759A (en) * 2021-05-12 2021-08-24 广州博冠信息科技有限公司 User interface processing method, user interface processing system, user interface processing device, and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10984175B2 (en) * 2013-08-09 2021-04-20 Yottaa Inc. Systems and methods for dynamically modifying a requested web page from a server for presentation at a client
US9882979B2 (en) * 2015-03-16 2018-01-30 International Business Machines Corporation Image file transmission

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2143914A1 (en) * 1994-03-04 1995-09-05 Hajime Enomoto Interactive information processing system
EP1686461A2 (en) * 2005-01-31 2006-08-02 Microsoft Corporation Method and system for a target device display simulation
CN106294413A (en) * 2015-05-25 2017-01-04 阿里巴巴集团控股有限公司 The loading method of picture and device
CN107633013A (en) * 2017-08-17 2018-01-26 广州酷狗计算机科技有限公司 Page picture generation method, device and computer-readable recording medium
CN107633066A (en) * 2017-09-21 2018-01-26 北京金山安全软件有限公司 Information display method and device, electronic equipment and storage medium
JP2019197308A (en) * 2018-05-08 2019-11-14 富士通株式会社 Source code conversion program and source code conversion method
WO2020006962A1 (en) * 2018-07-03 2020-01-09 北京字节跳动网络技术有限公司 Method and device for processing picture
CN109343845A (en) * 2018-08-14 2019-02-15 北京奇艺世纪科技有限公司 A kind of code file generation method and device
CN109508187A (en) * 2018-10-10 2019-03-22 国网新疆电力有限公司信息通信公司 Wechat public platform video text editing device construction method and its editing machine based on HTML
CN111199230A (en) * 2020-01-03 2020-05-26 腾讯科技(深圳)有限公司 Target detection method and device, electronic equipment and computer readable storage medium
CN112307408A (en) * 2020-11-24 2021-02-02 微医云(杭州)控股有限公司 Method and device for determining element information in page, electronic equipment and storage medium
CN113051514A (en) * 2021-03-26 2021-06-29 挂号网(杭州)科技有限公司 Element positioning method and device, electronic equipment and storage medium
CN113031938A (en) * 2021-04-25 2021-06-25 中国电子系统技术有限公司 Method and device for converting visual interface image into programming language data
CN113296759A (en) * 2021-05-12 2021-08-24 广州博冠信息科技有限公司 User interface processing method, user interface processing system, user interface processing device, and storage medium

Also Published As

Publication number Publication date
CN113821278A (en) 2021-12-21

Similar Documents

Publication Publication Date Title
US9081769B2 (en) Providing translation assistance in application localization
US10318646B2 (en) Generating a structured document guiding view
CN110795325A (en) Visual point burying method, device, equipment and storage medium
US10976899B2 (en) Method for automatically applying page labels using extracted label contents from selected pages
US5343409A (en) System and method for probing object resources in a window server environment
CN104516727B (en) The method and system for the resource changed in resource file
CN113158101B (en) Visual page rendering method, device, equipment and storage medium
CN112836074B (en) Wallpaper display method and equipment
CN110968305A (en) Applet visualization generation method, device, equipment and storage medium
CN109495549B (en) Method, equipment and computer storage medium for application pull alive
CN110990346A (en) File data processing method, device, equipment and storage medium based on block chain
CN110781427A (en) Method, device, equipment and storage medium for calculating first screen time
CN113127776A (en) Breadcrumb path generation method and device and terminal equipment
CN110737588A (en) automatic point burying method, device, medium and electronic equipment
US8719416B1 (en) Multiple subparts of a uniform resource locator
CN113821278B (en) Calling image size method, device, electronic equipment and storage medium
US20060248443A1 (en) System and method for exporting spreadsheet data
CN113687880B (en) Method, device, equipment and medium for calling component
CN108133029B (en) Map element adjusting method, device and equipment and computer-readable storage medium
CN114296852A (en) Method and device for displaying target page, electronic equipment and storage medium
CN111596997B (en) UI information request method, device, terminal and storage medium
CN114461214A (en) Page display method and device, electronic equipment and storage medium
CN114356475A (en) Display processing method, device, equipment and storage medium
CN112667939A (en) Webpage refreshing method and device, electronic equipment and storage medium
CN107749892B (en) Network reading method and device for conference record, intelligent tablet and storage medium

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
GR01 Patent grant
GR01 Patent grant