Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The GDI+ library is able to save tiff pictures.</p> <p>The SynGdiPlus unit use {557CF405-1A04-11D3-9A73-0000F81EF32E} for its TIFF encoder.</p> <p>From the <code>TSynPicture.SaveAs</code> code, I see two possibilities:</p> <ul> <li>Either you don't have the corresponding TIFF encoder installed;</li> <li>Either there is some missing parameter expected by the TIFF encoder.</li> </ul> <p>Try this version:</p> <pre><code>type /// the optional TIFF compression levels // - use e.g. ord(evCompressionCCITT4) to save a TIFF picture as CCITT4 TGDIPPEncoderValue = ( evColorTypeCMYK, evColorTypeYCCK, evCompressionLZW, evCompressionCCITT3, evCompressionCCITT4, evCompressionRle, evCompressionNone, (...) evFrameDimensionPage); const EncoderCompression: TGUID = '{e09d739d-ccd4-44ee-8eba-3fbf8be4fc58}'; function TSynPicture.SaveAs(Stream: TStream; Format: TGDIPPictureType; CompressionQuality: integer): TGdipStatus; var fStream: IStream; Len,Dummy: Int64; tmp: pointer; Params: TEncoderParameters; PParams: pointer; MS: TMemoryStream absolute Stream; begin if not Gdip.Exists or (Stream=nil) or (fImage=0) then begin result := stInvalidParameter; exit; end; Params.Count := 1; Params.Parameter[0].Type_ := EncoderParameterValueTypeLong; Params.Parameter[0].NumberOfValues := 1; Params.Parameter[0].Value := @CompressionQuality; PParams := nil; case Format of gptJPG: if CompressionQuality&gt;=0 then begin Params.Parameter[0].Guid := EncoderQuality; PParams := @Params; end; gptTIF: begin if not (TGDIPPEncoderValue(CompressionQuality) in [ evCompressionLZW, evCompressionCCITT3, evCompressionCCITT4, evCompressionRle, evCompressionNone]) then // default tiff compression is LZW CompressionQuality := ord(evCompressionLZW); Params.Parameter[0].Guid := EncoderCompression; PParams := @Params; end; end; CreateStreamOnHGlobal(0, true, fStream); (...) </code></pre> <p>It will add the <code>EncoderCompression</code> parameter for TIFF pictures, which <a href="http://msdn.microsoft.com/en-us/library/ms533839%28VS.85%29.aspx" rel="nofollow">seems to be required</a>.</p> <p>I've updated the source code repository version to include this correction.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload