Changing image size

gasomma

Member
Hello to all,

need to change image size before to export query to excel (2007).
Example:


CREATE "Excel.Application":U vchExcel.
vchExcel:VISIBLE = TRUE.
vchWorkbook = vchExcel:Workbooks:Add().
vchWorksheet = vchWorkbook:Worksheets(1).
vchPicture = vchWorksheet:pictures:INSERT("image").
vchPicture:TOP = vchWorksheet:Application:Range("A1"):TOP.
vchPicture:LEFT = vchWorksheet:Application:Range("A1"):LEFT.

How I can resize the image before open excel or give to excel image size.

Thx
JCA
 

RealHeavyDude

Well-Known Member
You need to distinguish between the ABL widget that displays the image and the image itself.
  • For the widget you can access the widget attributes directly.
  • For the image itself: Although the widget that displays the image is able to size the image when you set the STRETCH-TO-FIT attribute to TRUE, this functionality is not exposed so that you could use it to your advantage. AFAIK, there is no way other than to use a COM object that can do that and wrap it in the ABL.
Regards, RealHeavyDude.
 

mrobles

Member
Hi.

In addition

With this code ...
1.- You insert and select an image.
2-. Set the stretch to fit atributte to true
3.- Change the height attribute
4.- Change its top and left

chExcelApplication:activeSheet:pictures:INSERT('imagen.jpg'):SELECT.
chExcelApplication:Selection:ShapeRange:LockAspectRatio = -1.
chExcelApplication:Selection:ShapeRange:Height = 100.
chExcelApplication:Selection:ShapeRange:TOP = 20.
chExcelApplication:Selection:ShapeRange:LEFT = 50.

Thus, changing the height, width is changed

MRobles
 
Top