|
-
Jun 28th, 2007, 07:45 PM
#1
Thread Starter
Fanatic Member
[2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
I have made a picture viewer that can view alpha blended *.ICO files.
- I open the ICO file and find the 32bpp icon that is the largest icon.
- if there is no 32bpp (WinXP) style icon, it gets the 8 or 4bpp.
- I send it to the PictureBox, which has a white background.
- I click a copy button...
Clipboard.SetDataObject(picBox.Image)
When I paste it into say Windows Paint, it paints the background of the image blue. I want to maintain the white background.
How can I copy the image with the white background?
Or How can I take a snapshot of the Picture box and create a BMP image before copying?
Thanks
-
Jul 1st, 2007, 08:20 PM
#2
Thread Starter
Fanatic Member
-
Jul 2nd, 2007, 07:10 PM
#3
Thread Starter
Fanatic Member
Re: [2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
Sorry for the "bumps"... but I have distributed an application on my site (Desktop Suite) that I have been trying to fix the alpha blending for over a year.
I finally found a solution to at least display it... but now I can't copy it to the clipboard.
I need some answers to my problem!
See screenshot above of what it is doing.
Thanks
-
Jul 3rd, 2007, 08:17 AM
#4
Thread Starter
Fanatic Member
Re: [2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
Can I use GetDC() and BitBlt() to get what is visible in the picture box (NOT the PictureBox.Image)???
How could I use the GetDC and BitBlt??
Thanks
Last edited by penagate; Jul 3rd, 2007 at 09:53 AM.
-
Jul 3rd, 2007, 10:16 PM
#5
Thread Starter
Fanatic Member
Re: [2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
Can somebody help me??
-
Jul 5th, 2007, 06:25 AM
#6
Thread Starter
Fanatic Member
Re: [2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
I know you can use GDI to draw on a picturebox.
How would I draw a white background under the icon and then combine them into one picture?
-
Jul 5th, 2007, 03:31 PM
#7
Thread Starter
Fanatic Member
Re: [2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
Will an expert GDI person help me.... pleeeasssssssssssssse!
Ah oh, i'm begging now...
-
Jul 6th, 2007, 05:49 AM
#8
Thread Starter
Fanatic Member
Re: [2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
Well... What if I draw a white square on the picturebox first using GDI, then display the icon on top of the white square??
If I could do this, then I would need a way of combining the two into one image. Then when I copy and paste into an app it will have the white background.
What do you think??
-
Jul 6th, 2007, 04:33 PM
#9
Thread Starter
Fanatic Member
Re: [2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
Why isn't anybody helping me?
-
Jul 7th, 2007, 04:45 PM
#10
Thread Starter
Fanatic Member
Re: [2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
Well.... I guess I am posting to myself!!!
Hey self... could you help me??
-
Jul 7th, 2007, 08:16 PM
#11
Thread Starter
Fanatic Member
Re: [2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
Okay... self.
We are using this code to draw a fillrectangle on the picbox...
Code:
Private Sub picBox_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles picBox.Paint
Dim g As Graphics = e.Graphics
g.FillRectangle(Brushes.Teal, 0, 0, 128, 128)
End Sub
This code works fine.
The problem is that when my icon loads into the picture box, it is under the fillrectangle.
So, how do I get the icon (or any other image) to appear on top of my GDI fillrectangle??
-
Jul 7th, 2007, 08:54 PM
#12
Thread Starter
Fanatic Member
Re: [2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
Could anyone enlighten me on on how PictureBox layers work??
Why is GDI drawn on top of the .Image property and an external image is loaded IN the .Image property.
So, then How do I merge the two layers together?
And How can I control which image or drawing draws on which layer?
Is it possible to draw an external image on a GDI layer?
Any info would be great!!
-
Jul 8th, 2007, 11:42 AM
#13
Thread Starter
Fanatic Member
Re: [2005] Copy Icon From PicBx to ClipBoard (Alpha Blending)
Hey self... you got any answers yet?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|