XCAD.NET
XCAD.NET
Framework for .NET (C# and VB.NET) to create modern application for CAD systems (SOLIDWORKS, SOLIDWORKS Document Manager, Autodesk Inventor, etc.)
Get technical support Connect to xCAD community on Discord server Explore code and application examples xCAD.NET Templates for Visual Studio and VS Code Access source code

Bitmap control in SOLIDWORKS property Manager Page


Bitmap control
Bitmap control

Static bitmap will be created in the property manager page for the properties of Image type or other types assignable from this type, e.g. Bitmap

using System.Drawing;
using Xarial.XCad.Documentation.Properties;
using Xarial.XCad.UI.PropertyPage.Attributes;

public class BitmapDataModel
{
    public Image Bitmap { get; set; } = Resources.BitmapSample;

}

Bitmap size

Default size of the bitmap is 18x18 pixels, however this could be overridden using the BitmapOptionsAttribute by providing width and height values in the constructor parameters:

[BitmapOptions(48, 48)]
public Image BitmapLarge { get; set; } = Resources.BitmapSample;

Due to SOLIDWORKS API limitation bitmap cannot be changed as dynamic value after property manager page is displayed. Assign the image in the data model class constructor or as a default value of the property.


Powered by Docify