Completed
Last Updated: 12 Aug 2022 10:12 by ADMIN
Release R2 2021
Marco
Created on: 16 Mar 2021 08:41
Category: PictureBox
Type: Bug Report
1
RadPictureBox: transparency is lost after pasting an image with a transparent background

Steps to reproduce:

1. Copy an image with a transparent background to the Clipboard

2. Paste it in RadPictureBox.

As a result you will notice that the transparency is lost.

Note: it is possible to handle clicking the Paste menu item and control what image exactly to be pasted:

        public RadForm1()
        {
            InitializeComponent(); 

            this.radPictureBox1.ContextMenuItemClick += RadPictureBox1_ContextMenuItemClick;
        }

        private void RadPictureBox1_ContextMenuItemClick(object sender, HandledEventArgs e)
        {
            if (sender == this.radPictureBox1.ContextMenuProperties.PasteItem)
            {
                e.Handled = true;
                // Image extractedImage = // get image with transparency; 
                // this.radPictureBox1.Image = extractedImage;
            }
        }

7 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 12 Aug 2022 10:12
Hello, Carlos,   

According to the provided information, it seems that your custom scenario is more appropriate for discussing in a support ticket than to this public bug report which is already released.

I would kindly ask you to submit a support ticket from your Telerik account and provide a sample runnable project with the custom implementation that you have demonstrating the undesired behavior that you are facing. Thus, our support engineers would gladly assist you with your case: https://docs.telerik.com/devtools/winforms/knowledge-base/submit-support-tickets 

Thank you in advance for your understanding. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Carlos
Posted on: 09 Aug 2022 23:22

Sorry for my ugly English.. i will try again explain myself.

have two picturebox. 

one is for choose a picture

second is for choose a (photoframe) frame for the picture

both are ok.

With send picture to frame i send the picture as the backgroud of the picturebox with the photoframe.

and at the end when i want to create a single .jpg .. only save the picturebox without the background property

is attached a picture for better explanation.

many thxs

Attached Files:
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 08 Aug 2022 11:07

Hello, Carlos,   

Following the provided code snippet, I have tested the behavior on my end with the latest version when saving a free downloaded image with transparent background. The attached gif file illustrates the observed result on my end. It seems that the transparency is preserved.

It would be greatly appreciated if you can provide your sample image with a transparent background that loses its transparency after executing the code snippet. Thus, we would be able to test it locally and provide further assistance.

Thank you in advance for your cooperation. I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Carlos
Posted on: 05 Aug 2022 21:49

Hi there.. do u know if is a also a bug

im trying to save the picture and the backgroud in the same file.

im saving using bitmap.save but is  not saving the backgroud..  any ideas?

Many Thxs

my code.

 

         Bitmap varBmp = new Bitmap(radPictureBox1.Image);
            varBmp = varBmp.Clone(new RectangleF(0, 0, 485, 630), varBmp.PixelFormat);

            //Graphics myGraphics = this.CreateGraphics();
            Graphics newImage = Graphics.FromImage(varBmp);
            Size s = this.Size;
            memoryImage = new Bitmap(s.Width, s.Height, newImage);
            Graphics memoryGraphics = Graphics.FromImage(memoryImage);
            memoryGraphics.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, s);

            varBmp.Save("C:\\_dological\\pnnFrame\\ImpresionUNO.PNG",ImageFormat.Png);
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 04 Aug 2022 11:13

Hello, Marco,

As the status of the feedback item indicates, the issue has already been addressed and a fix was introduced in R2 2021 (version 2021.2.511).

In case you are still experiencing any further difficulties, please let me know what is the exact scenario and we will provide further assistance.

Thank you in advance.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Marco
Posted on: 04 Aug 2022 07:35
It should have been corrected in the last release. Out of that you can use the workaround provided.
Carlos
Posted on: 03 Aug 2022 21:41
did u solve it?