CN113821278A - Method and device for calling image size, electronic equipment and storage medium - Google Patents

Method and device for calling image size, electronic equipment and storage medium Download PDF

Info

Publication number
CN113821278A
CN113821278A CN202111037693.8A CN202111037693A CN113821278A CN 113821278 A CN113821278 A CN 113821278A CN 202111037693 A CN202111037693 A CN 202111037693A CN 113821278 A CN113821278 A CN 113821278A
Authority
CN
China
Prior art keywords
image
target
image size
determining
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.)
Granted
Application number
CN202111037693.8A
Other languages
Chinese (zh)
Other versions
CN113821278B (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

Images

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 an image size, wherein the method comprises the following steps: when the trigger target control is detected, determining target label information in the target program code; determining a target address corresponding to the image to be inserted according to the target label 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 to a target position. The problem of when needing to acquire the image size, through the inefficiency that the manual picture size of writing into brought, easily make mistakes is solved, realized acquireing the image size voluntarily, improved the efficiency of writing the code and the rate of accuracy of writing into the image size.

Description

Method and device for calling image size, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method and a device for calling image size, electronic equipment and a storage medium.
Background
The application now requires pictures to show some contents, such as: doctor head portraits, propaganda advertisement, icons and the like, and the pictures can show information vividly and in detail. When writing code, a developer needs to know the size of the picture when using the picture and then position the picture to a position.
There are many ways to write in the picture in the code, the first is to fill in the picture address through the Image tag, src attribute, and control the style of the picture through style attribute; the second is to set the size of the picture by the width and height attributes through the background-image attribute setting element in css.
The two methods both require the size of the picture, and the existing method is to find the picture, then check the size of the picture, and finally write the picture into the picture pattern.
Based on the above manner, the size of the picture needs to be manually checked, and the size of the picture needs to be manually edited, which is easy to occur.
Disclosure of Invention
The invention provides a method and a device for calling an image size, electronic equipment and a storage medium, and aims to achieve 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, where the method includes:
when the trigger target control is detected, determining target label information in the target program code;
determining a target address corresponding to the image to be inserted according to the target label 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 to a target position.
In a second aspect, an embodiment of the present invention further provides an apparatus for calling an image size, where the apparatus includes:
the label information determining module is used for determining target label information in the target program code when the trigger 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;
and 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 obtaining plug-in and inserting the image size to the target position.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of calling an image size as in any of the embodiments of the invention.
In a fourth aspect, embodiments of the present invention further provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the method for invoking an image size according to any one of the embodiments of the present invention.
According to the technical scheme of the embodiment, when the trigger target control is detected, target label information in a target program code 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 a target label; determining a target address corresponding to the image to be inserted according to the target label information, accessing the corresponding image according to the target address after the target address of the image to be inserted is determined, and acquiring the size of the image by the plug-in unit based on the preset image size; 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, inserting the image size to a target position to automatically acquire the size of the image, and writing or replacing the image size in the target position by judging whether the target label information in the image to be inserted contains image size information. The problem of when needing to acquire the image size, through the inefficiency that the manual picture size of writing into brought, easily make mistakes is solved, realized acquireing the image size voluntarily, improved the efficiency of writing the code and the rate of accuracy of inserting the image size.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a flowchart of a method for calling an image size according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a specific implementation process of a method for calling an image size according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for calling an 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 present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flowchart of a method for calling an image size according to an embodiment of the present invention, where the present embodiment is applicable to any situation where an image needs to be automatically obtained from a page and the size needs to be determined, the method may be executed by an apparatus for calling an image size, the apparatus may be implemented in a form of software and/or hardware, and the hardware may be an electronic device, such as a mobile terminal or a PC.
As shown in fig. 1, the method of this embodiment includes:
and S110, when the trigger target control is detected, determining target label information in the target program code.
The target control can be understood as an operation key for controlling the program code to detect when the user inserts the picture through the program code. The target control may be a self-defined combination shortcut key in a computer keyboard, or may be a program code detection control in a computer interface, or a certain control in a display interface, where the control is used to determine whether to execute the technical scheme to obtain the size of the image to be inserted. The triggering mode of triggering the target control can be that the user immediately triggers 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 label information may be understood as label information displayed in the program code, that is, the target label information, and attribute information of the image, such as a width value and a height value of the image, address information of the image, and the like, may be carried in the target label information.
It should be noted that, inserting the corresponding image to be inserted into the target position may be implemented by a pre-written program code. 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 the 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 trigger target control is detected, determining target label information in the target program code includes: when the trigger target control is detected, determining the current position information of the cursor; determining a target program code corresponding to the current position information based on a preset code acquisition method; and determining target label information in the target program code.
The cursor can be understood as a cursor generated at a position where a mouse can be identified when the mouse moves on a computer, the current position information of the cursor can also be understood as the current position information of the mouse in a 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 self-defined code function or a program code plug-in, and the specified program code can be acquired by the code acquisition method, and the code acquisition method can be various, for example, the code acquisition method can be acquired by a specified keyword in the program code, and when the keyword in the program code is detected, the program code associated with the keyword is acquired; the program code in the range of the starting line can be obtained by setting the starting line in the program code and detecting the starting line in the program code; or the code may also be obtained by setting a class name tag, and when the tag is clicked, the program code related to the tag is obtained. The target program code corresponding to the current position information can be understood as a code segment or a code line corresponding to the position where the marking cursor is currently located; the target label information may be understood as image label information carried in a target code segment or code line, and is used to represent image attribute information of an image to be inserted, for example, the target label information may represent foreground image (image) label information and may also represent background image (background-image) label information.
Specifically, when the user triggers the target control through a preset triggering mode, program code detection is started. The program code includes a plurality of program code segments, for example, the program code segments may include program code segments corresponding to the current position information of the cursor, and when the cursor moves on the computer interface, the program code segments corresponding to the current position information of the cursor may 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 the specified program code segment is preset, and according to the code acquisition method, the target program code corresponding to the current position information of the cursor is determined. Further, target tag information may be determined based on current position information of a cursor in the target code.
And 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 displayed, which is to be acquired through the target program code; the target address may be understood as the address of the image to be inserted to be acquired.
Specifically, after a target program code corresponding to the current position information of the cursor is acquired based on a preset code acquisition method, target tag information in the target program code may be determined, where the target tag information may include address information, size information, attribute information, and the like of an image to be inserted. According to the determined target label information, target address information corresponding to the image to be inserted can be determined.
Illustratively, the target tag information may include an src attribute, which in turn includes address information of the image to be inserted, so that the address of the image to be inserted may be obtained from the src. The image address represents an absolute path or a relative path of the image to be inserted, the value of src is url of the image to be inserted, the absolute url points to other sites, and the relative url points to a value in a site. The target label information can also contain a url attribute, and the url attribute can represent an image address, so that the image acquisition address to be inserted can be acquired in a url mode. Here, url can be understood as a resource locator, each resource information has a unique address, and this address is called url, so that the target address of the image to be inserted can be determined by url.
Optionally, the determining a target address corresponding to the image to be inserted according to the target tag information includes: if the target label information is consistent with a 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 a second preset label, determining a target address corresponding to the image to be inserted based on a second regular expression.
The first preset tag may be understood as a preset tag set according to a tag attribute of an image to be inserted, for example, a foreground image (img) attribute tag; 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 (background-image) attribute tag. The first preset label and the second preset label are only used as attribute labels of the image to be inserted and used for distinguishing the display type or the image type of the image to be inserted. Regular expressions are understood as a logical formula for operating on strings of characters, including common characters (e.g., letters between a and z) and special characters (called "meta characters"), by composing a "regular string" of characters from specific characters defined in advance and a combination of the specific characters, the "regular string" being used to express a filtering logic for the string of characters. A regular expression is a text pattern that describes one or more strings of characters to be matched when searching for 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. For example, the regular expression may be a value of a replacement image size, or may also be a value of a written image size, and the embodiment of the present invention does not specifically limit the specific content of the regular expression.
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 a target program code. And 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, further acquiring a corresponding image to be inserted based on the target address of the standard form, and determining the corresponding target address corresponding to the image to be inserted. And if the target label information is consistent with a second preset label, converting the acquired image address into a standard form based on a second regular expression, further 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 obtaining plug-in, and inserting the image size to the target position.
The image size acquiring plug-in may be understood as a tool capable of assisting a program to acquire an image size more conveniently, and may specifically be some software components, or program code in the form of code segments. The plug-in may be encapsulated in an object program code, and is configured to obtain image size information carried in object tag information of an image to be inserted after the obtained image to be inserted and an object address of the image to be inserted are obtained. The image size can be understood as the length and width of an image and can also be understood as a pixel of the image, and the length and width of the image and the pixel have a conversion relation, so that the length and width of the image can 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, 1 centimeter is about 28 pixels, but the number of pixels included in each centimeter is not equal at different resolutions, and specifically, the calculation may be performed according to the resolution of the image by 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 direction and the vertical direction of the image, for example, the size of the image is 480 × 800, which is understood to mean that the image is composed of 480 pixels in the horizontal direction and 800 pixels in the vertical direction. The target position may be understood as a position where image size information is filled out set in the target program code.
Specifically, in order to obtain the image size, an image size obtaining plug-in may be preset, after a target address corresponding to the image to be inserted is determined, the image size of the image to be inserted corresponding to the target address may be obtained by the image size obtaining plug-in, and then the obtained image size of the image to be inserted is inserted into the target position.
Optionally, the determining, by the plug-in unit, the image size of the image to be plugged in corresponding to the target address based on the preset image size includes: reading an image to be inserted corresponding to the target address by the plug-in unit based on the image size; and determining the image size corresponding to the image to be inserted based on the image size acquisition plug-in.
Specifically, after the target label information of the image to be inserted is identified, the target address of the image to be inserted can be obtained through the target label information, then the image to be inserted corresponding to the target address can be read by the plug-in unit based on the image size, and the image size corresponding to the image to be inserted is determined.
Optionally, the inserting the image size to the target position includes: and replacing the image size by a corresponding regular expression so as to write the image size at the target position.
Specifically, after the image size of the image to be inserted corresponding to the target address is determined based on the image size obtaining 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 or not, 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 and writing 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 of the embodiment, when the trigger target control is detected, target label information in a target program code 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 a target label; determining a target address corresponding to the image to be inserted according to the target label information, accessing the corresponding image according to the target address after the target address of the image to be inserted is determined, and acquiring the size of the image by the plug-in unit based on the preset image size; 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, inserting the image size to a target position to automatically acquire the size of the image, and writing or replacing the image size in the target position by judging whether the target label information in the image to be inserted contains image size information. The problem of when needing to acquire the image size, through the inefficiency that the manual picture size of writing into brought, easily make mistakes is solved, realized acquireing the image size voluntarily, improved the efficiency of writing the code and the rate of accuracy of inserting the image 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 an image size according to a second embodiment of the present invention.
In a specific example, before calling the size of the image to be inserted, the shortcut key may be configured using a keybindings tool, for example, setting the shortcut key to Ctrl + o. When a user presses a shortcut key Ctrl + o in a document through a cursor, an event of inserting an image size is triggered, that is, the technical scheme provided by the embodiment is executed, the image size of an 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 the target position to be displayed. When it is detected that the user triggers Ctrl + o, the target control is considered to be triggered, and at this time, the current position information of the cursor may be acquired by a cursor position information acquisition method, for example, the current position information of the cursor may be acquired by a gettextviewlinecontentingbufferfocation plug-in. Then, the object program code corresponding to the current position of the cursor is obtained based on the object code obtaining method, for example, the object program code corresponding to the current position of the cursor may be obtained based on the conteningtextviewline plug-in, and finally, the object tag information in the object program code is determined.
And setting a trigger area for triggering a target control in a program code compiling interface, and when a user presses a target control of a shortcut key Ctrl + o in the compiling interface, triggering code detection in a target code program to detect target label information in an image to be inserted and judge whether the target label information of the image to be inserted is a first preset label img label or a second preset label background image (background-image) label.
When the judgment result of the target label information of the image to be inserted is a first preset label foreground image (img) label, a target address of the image to be inserted is obtained from a src attribute label through a target code program, then a plug-in is obtained based on a preset image size, the obtained image address is converted into a standard form based on a first regular expression, a corresponding image to be inserted is obtained based on the target address of the standard form, and an attribute value of the image to be inserted is obtained, wherein the first regular expression can be a value obtained by using "/\\\ \ src \ b \ s ═ s [ \\'? ([ ^ a '\\\\\ \'? And/i' is represented. And then acquiring the image-size of the plug-in based on the image size to acquire the width and the height of the image to be inserted, and returning the size of the image to be inserted through the image size acquisition plug-in. And finally, judging the width and height values of the image to be inserted in the image attribute in the target label information of the image to be inserted, and if the width and height of the image to be inserted are contained in the image attribute, determining that the width and height values of the image to be inserted are larger than the width and height values of the image to be inserted in the target label information of the image to be inserted, and if the width and height values of the image to be inserted in the image attribute are contained in the image attribute, determining that the width and height values of the image to be inserted in the target label information of the image to be inserted are larger than the width and height values of the image to be inserted in the target label information of the image to be inserted in the image to be inserted in the image to be inserted in the image to be inserted in the image in the? ([ ^ a '\\\\\ \'? I' replacing original width and height in the image attribute; and if the image attribute does not contain the width and the height of the image to be inserted, directly writing the values of the width and the height of the image obtained by the image size acquisition plug-in into the image attribute.
When the judgment 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, then 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, 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 second regular expression can be represented by "/" |' | url | \ (| \)/g ". And then acquiring the image-size of the plug-in based on the image size to acquire the width and the height of the image to be inserted, and returning the size of the image to be inserted through the image size acquisition plug-in. Finally, judging the width and height values of the image to be inserted in the image attribute in the target label information of the image to be inserted, and replacing the original width and height values in the image attribute by a second regular expression "/"' | url \ (| \)/g if the width and height values of the image to be inserted are contained in the image attribute; and if the image attribute does not contain the width and the height of the image to be inserted, directly writing the values of the width and the height of the image obtained by the image size acquisition plug-in into the image attribute.
When the target tag information of the image to be inserted does not match either a foreground image (img) tag or a background-image (background-image) tag, the target program code ends.
According to the technical scheme of the embodiment, when the trigger target control is detected, target label information in a target program code 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 a target label; determining a target address corresponding to the image to be inserted according to the target label information, accessing the corresponding image according to the target address after the target address of the image to be inserted is determined, and acquiring the size of the image by the plug-in unit based on the preset image size; 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, inserting the image size to a target position to automatically acquire the size of the image, and writing or replacing the image size in the target position by judging whether the target label information in the image to be inserted contains image size information. The problem of when needing to acquire the image size, through the inefficiency that the manual picture size of writing into brought, easily make mistakes is solved, realized acquireing the image size voluntarily, improved the efficiency of writing the code and the rate of accuracy of inserting the image size.
EXAMPLE III
Fig. 3 is an apparatus for calling an image size according to a third embodiment of the present invention, where the apparatus includes: a tag information determination module 310, a target address determination module 320, and a size retrieval module 330.
A tag information determining module 310, configured to determine, when a trigger target control is detected, target tag information in target program code;
a target address determining module 320, configured to determine, according to the target tag information, a target address corresponding to the image to be inserted;
and the size calling module 330 is configured to determine an image size of the image to be inserted corresponding to the target address based on a preset image size obtaining plug-in, and insert the image size into the target position.
According to the technical scheme of the embodiment, when the trigger target control is detected, target label information in a target program code 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 a target label; determining a target address corresponding to the image to be inserted according to the target label information, accessing the corresponding image according to the target address after the target address of the image to be inserted is determined, and acquiring the size of the image by the plug-in unit based on the preset image size; 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, inserting the image size to a target position to automatically acquire the size of the image, and writing or replacing the image size in the target position by judging whether the target label information in the image to be inserted contains image size information. The problem of when needing to acquire the image size, through the inefficiency that the manual picture size of writing into brought, easily make mistakes is solved, realized acquireing the image size voluntarily, improved the efficiency of writing the code and the rate of accuracy of inserting the image size. On the basis of any optional technical solution 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 determination unit that determines a target 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 the target tag information in the target program code.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the target address determining module specifically includes:
the first preset label determining unit is used for determining a target address corresponding to the image to be inserted based on a first regular expression if the target label information is consistent with a first preset label;
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 a second preset label.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the size retrieving module specifically includes:
the image reading unit to be inserted is used for acquiring a plug-in unit based on the image size to read an image to be inserted corresponding to the target address;
and the image size determining unit is used for determining the image size corresponding to the image to be inserted based on the image size acquisition plug-in.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the size retrieving module is configured to:
and replacing the image size by a corresponding regular expression so as to write the image size at the target position.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, 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 the execution method.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary electronic device 40 suitable for use in implementing embodiments of the present invention. The electronic device 40 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 4, electronic device 40 is embodied in the form of a general purpose computing device. The components of electronic device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples the various system components (including the system memory 402 and the processing unit 401).
Bus 403 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, 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 may be any available media that is accessible by electronic device 40 and includes both volatile and nonvolatile 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. The 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, and 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, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are 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, for example, in 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 of which examples or some combination thereof may comprise 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.), with one or more devices that enable a user to interact with the electronic device 40, and/or with 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 be through input/output (I/O) interface 411. Also, the electronic device 40 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 412. As shown, the network adapter 412 communicates with the other modules of the electronic device 40 over the bus 403. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with electronic device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing, for example, a method of calling an image size provided by an embodiment of the present invention, by running a program stored in the system memory 402.
EXAMPLE five
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for invoking an image size, the method including:
when the trigger target control is detected, determining target label information in the target program code;
determining a target address corresponding to the image to be inserted according to the target label 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 to a target position.
Computer storage media for embodiments of the invention may employ 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. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 the context of 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.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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 any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. 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, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method of invoking an image size, comprising:
when the trigger target control is detected, determining target label information in the target program code;
determining a target address corresponding to the image to be inserted according to the target label 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 to a target position.
2. The method of claim 1, wherein determining target tag information in target program code when the trigger target control is detected comprises:
when the trigger target control is detected, determining the current position information of the cursor;
determining a target program code corresponding to the current position information based on a preset code acquisition method;
and determining target label information in the target program code.
3. The method according to claim 1, wherein the determining a target address corresponding to an image to be inserted according to the target tag information comprises:
if the target label information is consistent with a 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 a second preset label, determining a target address corresponding to the image to be inserted based on a second regular expression.
4. The method according to claim 1, wherein the determining the image size of the image to be inserted corresponding to the target address based on the preset image size obtaining plug-in comprises:
reading an image to be inserted corresponding to the target address by the plug-in unit based on the image size;
and determining the image size corresponding to the image to be inserted based on the image size acquisition plug-in.
5. The method of claim 1, wherein the inserting the image size to the target location comprises:
and replacing the image size by a corresponding regular expression so as to write the image size at the target position.
6. The method of claim 1, wherein the image size comprises a length and a width of the image.
7. An apparatus for invoking an image size, comprising:
the label information determining module is used for determining target label information in the target program code when the trigger 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;
and 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 obtaining plug-in and inserting the image size to the target position.
8. The apparatus of claim 7, wherein the tag information determining 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 determination unit configured to determine a target 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 the target tag information in the target program code.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of calling image size as recited in any of claims 1-6.
10. A storage medium containing computer-executable instructions for performing the method of calling image size of any of claims 1-6 when executed by a computer processor.
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 true CN113821278A (en) 2021-12-21
CN113821278B 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 (16)

* 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
US20150046789A1 (en) * 2013-08-09 2015-02-12 Yottaa Inc. Systems and methods for dynamically modifying a requested web page from a server for presentation at a client
US20160277492A1 (en) * 2015-03-16 2016-09-22 International Business Machines Corporation Image file transmission
CN106294413A (en) * 2015-05-25 2017-01-04 阿里巴巴集团控股有限公司 The loading method of picture and device
CN107633066A (en) * 2017-09-21 2018-01-26 北京金山安全软件有限公司 Information display method and device, electronic equipment and storage medium
CN107633013A (en) * 2017-08-17 2018-01-26 广州酷狗计算机科技有限公司 Page picture generation method, device and computer-readable recording 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

Patent Citations (16)

* 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
US20150046789A1 (en) * 2013-08-09 2015-02-12 Yottaa Inc. Systems and methods for dynamically modifying a requested web page from a server for presentation at a client
US20160277492A1 (en) * 2015-03-16 2016-09-22 International Business Machines Corporation Image file transmission
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

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TIANMENG1999: "js获取图片尺寸Image对象图片尺寸Image对象", Retrieved from the Internet <URL:https://blog.csdn.net/weixin_42448623/article/details/106329904> *

Also Published As

Publication number Publication date
CN113821278B (en) 2024-05-03

Similar Documents

Publication Publication Date Title
CN110362370B (en) Webpage language switching method and device and terminal equipment
US9792034B2 (en) Multi-source, multi-destination data transfers
US20050108636A1 (en) System and method of retrieving and presenting partial (skipped) document content
US20110145691A1 (en) Method for Sequenced Document Annotations
US9026900B1 (en) Invisible overlay for dynamic annotation
CN109918685B (en) Computer-aided translation method, device, computer equipment and storage medium
CN112307408B (en) Method and device for determining element information in page, electronic equipment and storage medium
CN112836074B (en) Wallpaper display method and equipment
CN113158101A (en) Visual page rendering method, device, equipment and storage medium
CN115391322A (en) Data checking method, device, equipment, storage medium and program product
CN112001153A (en) Text processing method and device, computer equipment and storage medium
CN107862035B (en) Network reading method and device for conference record, intelligent tablet and storage medium
US8719416B1 (en) Multiple subparts of a uniform resource locator
CN116245052A (en) Drawing migration method, device, equipment and storage medium
CN113821278B (en) Calling image size method, device, electronic equipment and storage medium
US11995129B2 (en) System and method for annotating website content
CN114296852A (en) Method and device for displaying target page, electronic equipment and storage medium
CN114528509A (en) Page display processing method and device, electronic equipment and storage medium
CN113687880A (en) Method, device, equipment and medium for calling component
CN114356475A (en) Display processing method, device, equipment and storage medium
CN109948251B (en) CAD-based data processing method, device, equipment and storage medium
CN112667939A (en) Webpage refreshing method and device, electronic equipment and storage medium
CN112364268A (en) Resource acquisition method and device, electronic equipment and storage medium
CN110515530B (en) Method, device and equipment for processing character operation and storage medium
CN116185412B (en) Data management method and device, electronic equipment 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