KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Interfaces > Viewing Interfaces > IVirtualView
IVirtualView Interface

IVirtualView Interface

Create
Render
Destroy
CreateModelView

IVirtualView interface allows rendering the current scene off-screen into a memory buffer. It can be used for obtaining snapshots of the 3D scene even of the control is not currently visible. IVirtualView can be queried from IView interface.

To take a snapshot of the current 3D view call Create method. Call IBitmap.GetBitmapData to obtain IBlob of the bitmap. Call Render method to take a snapshot. Use IBlob.Save or IBlob.CopyTo to store the image or use it in memory. Call Destroy to free memory associated with the view when it is no longer needed.

The Render calls can be made repeatedly, most likely after some manual or programmatic manipulations of 3D view. Normally Create method is called once during initialization of the application or  when the first off-screen rendering is required.

Background transparency in dual mode is not supported by IVirtualView, but it is possible to set color of the background which appears in the resulting image by setting the color property BackgrColorVirtualViewDualMode via: KernCAD > GetView() >IView > IKCContext2 > SetColorParam(1, ...)

See also: Capture SampleInterface List


HRESULT Create(PairInt* size, IBitmap** buffer)

Parameters

size - [in] - Dimensions of the memory buffer to be created, or NULL. See remarks.

buffer - [out] Newly created bitmap, which contains image of the current scene

Remarks

The methods creates a new bitmap, which will be used as a virtual memory window to draw into. If size parameter is NULL or size.x and size.y are zero, dimensions of the current control window are used instead. It is not an error to call this method repeatedly. The relevant resources are allocated only on the first call.


HRESULT Render()

Remarks

The methods performs rendering of the current model with the current configuration of 3D view into off-screen bitmap created with the Create method.


HRESULT Destroy()

Remarks

Releases all resources associated with the virtual view. Virtual View is destroyed automatically on closing the application.


HRESULT CreateModelView(IModel* model, PairInt* size, IBitmap** buffer)

Parameters

model - [in] The object to be rendered
size - [in] Dimensions of the output image
buffer - [out] Newly created bitmap, which contains an image of the model normally displayed on load in a window. See Create() above for details