Recent

Author Topic: [DONE - NOT SOLVED] AutoSize BCSVGViewer to SVG image  (Read 1169 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1260
[DONE - NOT SOLVED] AutoSize BCSVGViewer to SVG image
« on: July 17, 2019, 12:01:57 am »
I tried to use BCSVGViewer.AutoSize:=True, but the container width/height doesn't work conform the svg w/h.


I can load am SVG directly.

But I want to beable to use Zoom In/Out instead of stretching to fit container


But, I can seem to get the width/height to autosize to the actual svg width/height.... we are talking about the border of the BCSVGViewer resizing here.


Any ideas how to get around this?
« Last Edit: July 18, 2019, 12:02:14 am by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: AutoSize BCSVGViewer to SVG image
« Reply #1 on: July 17, 2019, 10:28:46 pm »
I am not sure I understand though I imagine you would like to zoom and move around the SVG. TBVSVGViewer provides only basic placement/stretching.

For this, you need to use for example a TBGRAVirtualScreen and draw the SVG the way you want in it. There are various drawing functions that take coordinates and zoom level.

The AutoSize property may need some fix, because in theory, the SVG would then be the size according to some default DPI.
Conscience is the debugger of the mind

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: AutoSize BCSVGViewer to SVG image
« Reply #2 on: July 18, 2019, 12:01:48 am »
I am not sure I understand though I imagine you would like to zoom and move around the SVG. TBVSVGViewer provides only basic placement/stretching.

For this, you need to use for example a TBGRAVirtualScreen and draw the SVG the way you want in it. There are various drawing functions that take coordinates and zoom level.

The AutoSize property may need some fix, because in theory, the SVG would then be the size according to some default DPI.

Yeah, I know its scalable, but it does have an initial size that it was created at.

I was thinking the Autosize just like a TImage... the border conforms to the image dimension.

Was just wondering. Thanks

Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: AutoSize BCSVGViewer to SVG image
« Reply #3 on: July 18, 2019, 01:29:32 pm »
Yeah, I know its scalable, but it does have an initial size that it was created at.

I was thinking the Autosize just like a TImage... the border conforms to the image dimension.
Indeed. I think it is just not implemented yet.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018