VueJS 선택한 위치의 x,y값에 실제로 이미지를 올리면
추천0 비추천 0
페이지 정보
작성자 앤더비 작성일 2022-06-13 16:55 조회 945회 댓글 0건제품 버전 : 14.2.4
컨트롤 이름 : picture.add
본문
관련링크
안녕하세요. 셀을 클릭해서 해당 위치에 이미지를 넣고 있는데요,
zoom 100%, 스크롤 안내린 상태에서는 이미지가 위치에 잘 들어갑니다.
그런데 스크롤을 내리거나, zoom을 변경하게 되면 이미지가 선택한 위치기 아닌 다른곳에 배치 됩니다.
스크롤&zoom 비율을 계산식으로 사용하여 x,y 값을 변환하여야 할까요?
const that = this; this.spread.bind(GC.Spread.Sheets.Events.CellClick, function(e, args) { const sheetArea = args.sheetArea === 0 ? 'sheetCorner' : args.sheetArea === 1 ? 'columnHeader' : args.sheetArea === 2 ? 'rowHeader' : 'viewPort'; if (sheetArea === 'viewPort') { const activeSheetIdx = that.spread.getActiveSheetIndex(); var sheet = that.spread.getSheet(activeSheetIdx); var cellRect = sheet.getCellRect(args.row, args.col); console.log('X coordinate:' + cellRect.x); console.log('Y coordinate:' + cellRect.y); console.log('Cell width:' + cellRect.width); console.log('Cell height:' + cellRect.height); that.toDataURL(that.mysignUrl, function(dataUrl) { const picture = sheet.pictures.add( 'test1', dataUrl, cellRect.x, cellRect.y, 90, 40 ); }); } });
댓글목록
등록된 댓글이 없습니다.