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

Add Suport to Bitmap Button #6

Closed
emersonbottero opened this issue Aug 2, 2020 · 9 comments
Closed

Add Suport to Bitmap Button #6

emersonbottero opened this issue Aug 2, 2020 · 9 comments
Assignees
Milestone

Comments

@emersonbottero
Copy link

image

@artem1t artem1t self-assigned this Aug 2, 2020
@artem1t artem1t added this to the v0.6 milestone Aug 2, 2020
@artem1t
Copy link
Contributor

artem1t commented Aug 2, 2020

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
Copy link
Author

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
Copy link
Contributor

artem1t commented Aug 12, 2020

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
Copy link
Contributor

artem1t commented Sep 8, 2020

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

  • Bitmap button can be added on Action property or on bool property (toggle)
  • Image will be automatically altered by the framework so it is not cropped by the button border (as per API docs), so no need to do any modifications with image beforehand
  • Both custom and standard images can be used
  • API supports both pre 2016 and post 2016 version of SW API

Links:

@emersonbottero
Copy link
Author

didn't worked for me.
image

@artem1t
Copy link
Contributor

artem1t commented Sep 13, 2020

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

@artem1t
Copy link
Contributor

artem1t commented Sep 13, 2020

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

@emersonbottero
Copy link
Author

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

@artem1t
Copy link
Contributor

artem1t commented Sep 15, 2020

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: #19

@artem1t artem1t closed this as completed Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants