Image obtaining method and apparatus, server, and electronic device
AssigneeVivo Mobile Communication Co., Ltd.
InventorFei Gong
Life of this patent
Estimating the term…
Abstract
An image obtaining method and apparatus, a server, and an electronic device are provided. The method includes: receiving screen size information sent by an electronic device; determining a target preview that matches the screen size information; and sending the target preview to the electronic device. The target preview may be determined based on the screen size information of the electronic device, so that the electronic device may display the target preview that matches the screen size information of the electronic device, thereby improving a display effect of the preview.
Claims2
An image obtaining method, performed by a server, comprising:
- receiving screen size information sent by an electronic device;
- determining a target preview image that matches the screen size information;
- and
- sending the target preview image to the electronic device,
- wherein the determining a target preview image that matches the screen size information comprises:
- obtaining an initial preview image and a preview element;
- adjusting a size of the initial preview image to a target size based on the screen size information, to obtain an intermediate preview image;
- and
- adjusting a display position of the preview element in the intermediate preview image to obtain the target preview image,
- wherein the adjusting a size of the initial preview image to a target size based on the screen size information, to obtain an intermediate preview image comprises:
- obtaining a first distance between a first area and a second area in the initial preview image in a length direction;
- determining a length difference based on a first length and a second length of the initial preview image, wherein the first length is determined based on the screen size information;
- determining a second distance between the first area and the second area in the length direction based on the length difference;
- and
- stretching or cutting an area between the first area and the second area in the initial preview image, so that a distance between the first area and the second area in the length direction is the second distance, to obtain the intermediate preview image;
- or
- obtaining a third distance between a third area and a fourth area in the initial preview image in a width direction;
- determining a width difference based on a first width and a second width of the initial preview image, wherein the first width is determined based on the screen size information;
- determining a fourth distance between the third area and the fourth area in the width direction based on the width difference;
- and
- stretching or cutting an area between the third area and the fourth area in the initial preview image, so that a distance between the third area and the fourth area in the width direction is the fourth distance, to obtain the intermediate preview image.
An image obtaining apparatus, comprising:
- a memory having a computer program stored thereon;
- and a processor, wherein the computer program, when executed by the processor, causes the processor to perform an image obtaining method, comprising:
- receiving screen size information sent by an electronic device;
- determining a target preview image that matches the screen size information;
- and
- sending the target preview image to the electronic device,
- wherein the determining a target preview image that matches the screen size information comprises:
- obtaining an initial preview image and a preview element;
- adjusting a size of the initial preview image to a target size based on the screen size information, to obtain an intermediate preview image;
- and
- adjusting a display position of the preview element in the intermediate preview image to obtain the target preview image,
- wherein the adjusting a size of the initial preview image to a target size based on the screen size information, to obtain an intermediate preview image comprises:
- obtaining a first distance between a first area and a second area in the initial preview image in a length direction;
- determining a length difference based on a first length and a second length of the initial preview image, wherein the first length is determined based on the screen size information;
- determining a second distance between the first area and the second area in the length direction based on the length difference;
- and
- stretching or cutting an area between the first area and the second area in the initial preview image, so that a distance between the first area and the second area in the length direction is the second distance, to obtain the intermediate preview image;
- or
- obtaining a third distance between a third area and a fourth area in the initial preview image in a width direction;
- determining a width difference based on a first width and a second width of the initial preview image, wherein the first width is determined based on the screen size information;
- determining a fourth distance between the third area and the fourth area in the width direction based on the width difference;
- and
- stretching or cutting an area between the third area and the fourth area in the initial preview image, so that a distance between the third area and the fourth area in the width direction is the fourth distance, to obtain the intermediate preview image.
Dependencies are inferred from the claim text.