Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using BitmapExporter to Export Png Failed on IIS (Azure Website) Environment #168

Open
fengyj opened this issue Jun 17, 2015 · 2 comments
Open

Comments

@fengyj
Copy link

fengyj commented Jun 17, 2015

Hi Sir,

I have a website, it allows user to upload a stl file, then the website will generate a png file for the user. I can get correct result on my local pc (hosted in IIS Express), but when I put it to Azure website, only an empty png with the background was generated without any exception. And I've tried remote debug, but found nothing.

@fengyj
Copy link
Author

fengyj commented Jun 17, 2015

Here is the code I used to generate image.

    public static void Export(Model3DGroup model, string outputFileName)
    {
        var viewport = new Viewport3D();

        viewport.Measure(new Size(320, 240));
        viewport.Arrange(new Rect(0, 0, 320, 240));

        var root = new ModelVisual3D();
        viewport.Children.Add(root);

        var camera = new PerspectiveCamera();
        camera.Position = new Point3D(2, 16, 20);
        camera.LookDirection = new Vector3D(-2, -16, -20);
        camera.UpDirection = new Vector3D(0, 0, 1);
        camera.FieldOfView = 45;
        camera.NearPlaneDistance = 0.1;
        camera.FarPlaneDistance = double.PositiveInfinity;

        viewport.Camera = camera;

        root.Children.Add(new DefaultLights());

        root.Content = model;

        CameraHelper.ZoomExtents(camera, viewport);
        Viewport3DHelper.Export(viewport, outputFileName, Brushes.WhiteSmoke);
    }

@objorke objorke changed the title Using BitmapExporter to Expoert Png Failed on IIS (Azure Website) Environment Using BitmapExporter to Export Png Failed on IIS (Azure Website) Environment Jul 28, 2015
@niklr
Copy link

niklr commented Aug 8, 2015

I experience a similar issue without using Azure Website but IIS 10. Running the website with the help of Visual Studio (IIS Express) everything seems to be fine, but once published to IIS it produces black images only.

Any help/hint is highly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants