Home > Back-end >  Through ole insert into excel to insert images and artificial image difference
Through ole insert into excel to insert images and artificial image difference

Time:09-17

Everyone a great god, and doing a small program, recently Delphi through ole to excel the location specified insert images, and to reduce the image size;
The insert images and reduce image of normal operation, but after the operation, I found a problem:
By Delphi inserted images, drag and drop to the original size, showed a sharp drop in quality, the picture is fuzzy;
And by artificial in excel insert images, by dragging reduced after enlarged to its original size, image is the basic no change;

Consult everybody a great god, how should the Delphi operations, can not change the quality of the original image?

Note:
1, scene record macro, and insert images cannot be recorded with the operation of the zoom in pictures, is to check the operation of the online data;
2, test the way the two change image size, one is through the picture. The width and height method to change the size,
Another is by selection. The ShapeRange. Scalewidth and scaleheight method to change the size, the effect is almost all loss of image quality;
3, I thought it was the cause of the vector diagram, but test the ps eps format image generated by the software, found that cannot perform the insert;
Because we can not record macro, cannot know whether there is another. Insert pictures method

CodePudding user response:

, Delphi through ole to excel the location specified insert images, and to reduce the image size
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
In my impression, add images have additional properties, decided to images are added according to the original photo, or according to the size of the specified zoom to add, I look through office most secondary development documents

CodePudding user response:

Reply to the moon and sun LuMing:
On online, I didn't find of the secondary development of useful office documents, most of them are, by using the method of record macro because I'm not too will be looking for this kind of information from the Internet, I don't know a great god have any related information? thank you

CodePudding user response:

 
WorkRange:=XLApp ActiveSheet. Range [XLApp. ActiveSheet. Cells. The Item [1, 1], XLApp. ActiveSheet. Cells. The Item [1, 1]].
XLApp. ActiveSheet. Rows [1]. The RowHeight:=50;
WorkRange. ColumnWidth:=50;
Picture:=XLApp ActiveSheet. Pictures. Insert (PicPath);
Picture. Left:=workRange. Left + 1;//left
Picture. Top:=workRange. Top + 1;//high
Picture. Width:=workRange. Width - 2;//width
Picture. Height:=workRange. Height - 2;//height


Not the old version of Office testing, this not line?

CodePudding user response:

By ole Woed or the operation of the excel, slow, and very poor, less Yu and third party controls,

CodePudding user response:

The
reference 3 floor harvardfeng response:
 
WorkRange:=XLApp ActiveSheet. Range [XLApp. ActiveSheet. Cells. The Item [1, 1], XLApp. ActiveSheet. Cells. The Item [1, 1]].
XLApp. ActiveSheet. Rows [1]. The RowHeight:=50;
WorkRange. ColumnWidth:=50;
Picture:=XLApp ActiveSheet. Pictures. Insert (PicPath);
Picture. Left:=workRange. Left + 1;//left
Picture. Top:=workRange. Top + 1;//high
Picture. Width:=workRange. Width - 2;//width
Picture. Height:=workRange. Height - 2;//height


Not the old version of Office testing, this not line?


This not line, I just insert this way

CodePudding user response:

reference 4 floor lyhoo163 response:
by ole Woed or the operation of the excel, slow, and very poor, less Yu and third party controls,


Have a mature control? Delphi's own is not working, so I never consider, thank you for your advice
Now my way is to use GDI + algorithm, resizing images into the size of the need, and then the original insert into, effect is better, but can not reach the ideal state
  • Related