Q&A - Question

GisExportToImage

Question
MiaS asked on December 02, 2017, keyword: Developer Kernel
Hello everybody ,

i'm trying to Export an Image of the Visible GisViewer.

I'm using this code from the Example

http://docs.tatukgis.com/DK11/samples:src:vcl:pas:viewer:mainform_pas


But it gives me an Access Violation cause lp is nil after
 
lp := GisCreateLayer( path, path ) as TGIS_LayerPixel ; 

Any Idea why lp is nil ?
 
 lp := GisCreateLayer( path, path ) as TGIS_LayerPixel ;
  try
    sf := TGIS_LayerPixelSubFormat.Create(
            TGIS_PixelFormat.RGB,
            False,
            sub,
            comp,
            90
          ) ;
    lp.Build( lp.Path, False, GIS.CS, ex, w, h, sf  ) ;
 
    pem := TGIS_PixelExportManager.Create( lp ) ;
    try
      pem.BusyEvent := GISBusy ;
      vbmp := TGIS_ViewerBmp.Create( 512, 512 ) ;
      try
        vbmp.PaintExtraEvent := GIS.PaintExtraEvent ;
        pem.ExportFrom( GIS, vbmp, ex, w, h, dpi ) ;
      finally
        vbmp.Free ;
      end;
    finally
      pem.Free ;
    end;
  finally
    lp.SaveData ;
    lp.Free ;
  end;
 
Answers
Tomasz Kosinski (TatukGIS) replied December 02, 2017
What is the value of path?
 
If you would like to answer the question please Sign In.
*
*
Please review our recent Privacy Policy.
If you have any questions or requests, please contact us.
Rules
The Questions and Answers (Q & A) is intended to provide a means of communication between TatukGIS customers.
 
  1. Licensed users (with active maintenance play) of TatukGIS products may contribute to the Q & A content. Read-only access is available to anyone.
  2. Keep the content positive and professional.
  3. Be courteous to others by posting information when a question or issue asked on the Q & A is answered or resolved by other means (such as with help from TatukGIS technical support). Offer others at least a hint how the posted question was answered or the issue was resolved.
  4. The Q & A is not a replacement for TatukGIS technical support. TatukGIS team may or may not regularly follow or contribute content.