xarial / xcad

Framework for developing CAD applications for SOLIDWORKS, including add-ins, stand-alone applications, macro features, property manager pages, etc.
https://xcad.net
MIT License
134 stars 29 forks source link

Add Suport to Bitmap Button #6

Closed emersonbottero closed 4 years ago

emersonbottero commented 4 years ago

image

artem1t commented 4 years ago

I think the best way to implement this is to thread the [IconAttribute] as the icon and generated bitmap button instead of the normal button.

[Icon(typeof(Resources), nameof(Resources.btn_icon)]
public Action Button { get; set; }

Additionally, add the StandardBitmapButtonIconAttribute to have an ability to assign all standard icons, similar to StandardControlIconAttribute

emersonbottero commented 4 years ago

Hi @artem1t . Do you want me to implement it and send you an PR? 🤓 I may need some instructions but I reeeeeeeealy like the way you code and how you use SOLID principles in the implementation.

artem1t commented 4 years ago

Hi @emersonbottero, that would be fantastic! I am looking for contributors. Please do not hesitate to reach me on info@xarial.com for any questions. I also recently opened the subreddit: https://reddit.com/r/xcad

artem1t commented 4 years ago

This is now implemented and available in preview builds, will be later merged in release.

Links:

emersonbottero commented 4 years ago

didn't worked for me. image

artem1t commented 4 years ago

Looks like some issue with image conversion. Could you please attach the image you are using or send it to info@xarial.com?

artem1t commented 4 years ago

And just to confirm you are using .NET Core 3.1?

emersonbottero commented 4 years ago

I just sent the e-mail. I'm using .net framework

artem1t commented 4 years ago

Thank you. I have confirmed this is related to the image pixel format. If you save it as PNG or 24 bit bmp - issue is not reproducible.

I have opened bug for that: https://github.com/xarial/xcad/issues/19