setControl

来源:互联网 发布:j2ee网盘系统源码 编辑:程序博客网 时间:2024/05/16 04:17
public static void setControl(ReportShapeControl _shape,ReportBitmapControl _bitmap,ItemId _itemId,BomId _bomId = ""){    ItemId              curItemId;    BomId               curBomId;    InventBatch         curInventBatch;    FilenameOpen        filename;    Image               goodsImage = new image();    EajZoomBitmap       zoomBitmap;    int                 w,h;    real                oldLeftValue,newLeftValue;    real                oldTopValue,newTopValue;    ;    //curItemId       = InventBatch::findItemId(_inventBatchId);    //curInventBatch  = InventBatch::find(_inventBatchId,curItemId);    //curBomId        = curInventBatch.BOMId ;    filename = EajPublic::EajGetPicFilename(_ItemId,_bomId);    if (WinAPI::fileExists(filename))    {        goodsImage.loadImage(filename);        W = goodsImage.width() ;        H = goodsImage.height();        _bitmap.resizeBitmap(true);        zoomBitmap = new EajZoomBitmap(_shape.widthValue(),_shape.heightValue(),w,h);        zoomBitmap.resize();        oldLeftValue    = _shape.leftValue();        newLeftValue    = oldLeftValue + _shape.widthValue()/2 - zoomBitmap.width()/2;        oldTopValue     = _shape.topValue();        newTopValue     = oldTopValue + _shape.heightValue()/2 - zoomBitmap.height()/2;        _bitmap.top(newTopValue,Units::mm);        _bitmap.left(newLeftValue,Units::mm);        _bitmap.width(zoomBitmap.width(),units::mm);        _bitmap.height(zoomBitmap.height(),units::mm);    }}

原创粉丝点击