|
|
|
start date: Wed, 4 Jul 2007 10:25:26 -0400,
posted on: microsoft.public.dotnet.framework.drawing
back
| Thread Index |
|
1
active
|
|
2
Michael Phillips, Jr. 0.c0m
|
|
3
active
|
|
4
Michael Phillips, Jr. 0.c0m
|
|
5
active
|
How to mess up Powel's GIF transparent colour code
In Powel's
GIF transparent color article in the FAQ
add one of the following at the top of
Private Sub panel1_Paint
Seems to me that putting the palette on the clipboard and then retrieving it
should not change anything.
Can you see what is wrong here?
Thanks
1)
Private Sub panel1_Paint(...
Dim DataO1 As New DataObject
DataO1.SetData(DataFormats.Palette, False, cp)
Clipboard.SetDataObject(DataO1, False)
Dim DataO2 As DataObject = CType(Clipboard.GetDataObject(), DataObject)
Dim cp2 As ColorPalette = CType(DataO2.GetData(DataFormats.Palette),
ColorPalette)
cp = cp2
2)
Private Sub panel1_Paint(...
Clipboard.SetData(DataFormats.Palette, cp)
Dim cp2 As ColorPalette = CType(Clipboard.GetData(DataFormats.Palette),
ColorPalette)
cp = cp2
Date:Wed, 4 Jul 2007 10:25:26 -0400
Author:
|
Re: How to mess up Powel's GIF transparent colour code
The clipboard format DataFormats.Palette is a handle to a GDI HPALETTE not a
System.Drawing.Imaging.ColorPalette object.
Date:Wed, 4 Jul 2007 13:57:01 -0400
Author:
|
Re: How to mess up Powel's GIF transparent colour code
DataO.SetData(DataFormats.Palette, False, SomePalette)
Clipboard.SetDataObject(DataO, False)
Does the above place a HPALETTE object on the clipboard?
how about
Clipboard.SetData(DataFormats.Palette, SomePalette)
Thanks for the info
"Michael Phillips, Jr." <mphillips53@nospam.jun0.c0m> wrote in message
news:%23RojzSmvHHA.4784@TK2MSFTNGP06.phx.gbl...
> The clipboard format DataFormats.Palette is a handle to a GDI HPALETTE not
> a System.Drawing.Imaging.ColorPalette object.
>
Date:Wed, 4 Jul 2007 21:47:49 -0400
Author:
|
Re: How to mess up Powel's GIF transparent colour code
You have multiply posted this same issue.
Check my response to you in the vb newsgroup.
> Clipboard.SetData(DataFormats.Palette, SomePalette)
As I explained in my post to you, DataFormats.Palette is a private clipboard
format
that probably was intended for use with a ColorPalette object set to the
clipboard via an IStream
The DataObject implementation appears to be flawed as the canonical
clipboard format for the palette uses an HPALETTE not a ColorPalette object.
This is what Photoshop uses to place a palette on the clipboard. The .Net
implementation does not convert the ColorPalette to an HPALETTE or the
reverse.
You need to place an HPALETTE on the clipboard via P-Invoke using the
CF_PALETTE clipboard format. You need to do the conversion yourself.
" active" wrote in message
news:%23md4WjqvHHA.784@TK2MSFTNGP05.phx.gbl...
> DataO.SetData(DataFormats.Palette, False, SomePalette)
> Clipboard.SetDataObject(DataO, False)
>
> Does the above place a HPALETTE object on the clipboard?
>
>
>
>
> how about
>
> Clipboard.SetData(DataFormats.Palette, SomePalette)
>
> Thanks for the info
>
>
>
>
> "Michael Phillips, Jr." <mphillips53@nospam.jun0.c0m> wrote in message
> news:%23RojzSmvHHA.4784@TK2MSFTNGP06.phx.gbl...
>> The clipboard format DataFormats.Palette is a handle to a GDI HPALETTE
>> not a System.Drawing.Imaging.ColorPalette object.
>>
>
>
Date:Thu, 5 Jul 2007 09:27:37 -0400
Author:
|
Re: How to mess up Powel's GIF transparent colour code
"Michael Phillips, Jr." <mphillips53@nospam.jun0.c0m> wrote in message
news:%23IKN7gwvHHA.4076@TK2MSFTNGP06.phx.gbl...
> You have multiply posted this same issue.
I didn't get a respose here so I tried there.
Then got two responses from you.
Knowing for sure that Phoshop places an HPALETTE object helps a lot.
Thanks
>
> Check my response to you in the vb newsgroup.
>
>> Clipboard.SetData(DataFormats.Palette, SomePalette)
>
> As I explained in my post to you, DataFormats.Palette is a private
> clipboard format
> that probably was intended for use with a ColorPalette object set to the
> clipboard via an IStream
>
> The DataObject implementation appears to be flawed as the canonical
> clipboard format for the palette uses an HPALETTE not a ColorPalette
> object.
>
> This is what Photoshop uses to place a palette on the clipboard. The .Net
> implementation does not convert the ColorPalette to an HPALETTE or the
> reverse.
>
> You need to place an HPALETTE on the clipboard via P-Invoke using the
> CF_PALETTE clipboard format. You need to do the conversion yourself.
>
>
> " active" wrote in message
> news:%23md4WjqvHHA.784@TK2MSFTNGP05.phx.gbl...
>> DataO.SetData(DataFormats.Palette, False, SomePalette)
>> Clipboard.SetDataObject(DataO, False)
>>
>> Does the above place a HPALETTE object on the clipboard?
>>
>>
>>
>>
>> how about
>>
>> Clipboard.SetData(DataFormats.Palette, SomePalette)
>>
>> Thanks for the info
>>
>>
>>
>>
>> "Michael Phillips, Jr." <mphillips53@nospam.jun0.c0m> wrote in message
>> news:%23RojzSmvHHA.4784@TK2MSFTNGP06.phx.gbl...
>>> The clipboard format DataFormats.Palette is a handle to a GDI HPALETTE
>>> not a System.Drawing.Imaging.ColorPalette object.
>>>
>>
>>
>
>
Date:Thu, 5 Jul 2007 10:28:12 -0400
Author:
|
|
|