Defines a custom TBitmap codec for reading SVGs into a TBitmap
Note: for XE3+ only
Note
|
Unfortunately, because of how TCustomBitmapCodec works, there is no way to find out how big the requested bitmap should be and then drawing an SVG at that resolution. The size of the bitmap returned from TRSSVGCodec class will be the width and height of the SVG. This can be either the SVG ViewBox width and height (if defined) or calculated based on the SVG elements. This can be significantly smaller than the desired bitmap size if you were reading into a TImage for example. It is generally recommended that you create a TBitmap yourself at the size desired and then draw to the bitmap using DrawSVGToBitmap.
|
Namespace: FMX.RS.SVGCodec
TBitmapCodec
FMX.RS.SVGCodec.TRSSVGCodec
|
Delphi
|
type
TRSSVGCodec = class(TBitmapCodec)
end;
|
|
Name
|
Description
|
|
GetImageSize(string)
|
Returns the width and height of the SVG. This can be either the SVG ViewBox width and height (if defined) or calculated based on the SVG elements
|
|
IsValid(TStream)
|
Returns true if the stream contains a valid SVG
|
|
LoadFromFile(string,TOutBitmap)
|
Loads a SVG from a file and puts it into a bitmap surface. The size of the bitmap is dependant on the SVG width and height (see GetImageSize )
|
|
LoadFromStream(TStream,TOutBitmap)
|
Loads a SVG from a stream and puts it into a bitmap surface. The size of the bitmap is dependant on the SVG width and height (see GetImageSize )
|
|
LoadThumbnailFromFile(string,Single,Single,Boolean,TOutBitmap)
|
Loads a SVG from a file and puts it into a bitmap surface. The size of the bitmap will be equal to AFitWidth and AFitHeight.
|
|
SaveToFile(string,TOutBitmap,PBitmapCodecSaveParams)
|
Not implemented and raises an exception
|
|
SaveToStream(TStream,TOutBitmap,string,PBitmapCodecSaveParams)
|
Not implemented and will raise an exception
|
Top
|