mail-archives/gtk-sharp-list/attachments/20100120/0be84dcc/attachment.html

57 строки
5.0 KiB
HTML

<tt>
&lt;font&nbsp;style=&quot;font-family:&nbsp;Arial,&nbsp;Helvetica,&nbsp;sans-serif;&nbsp;font-size:&nbsp;10pt&quot;&gt;Thanks&nbsp;for&nbsp;the&nbsp;input.&amp;nbsp;&nbsp;That&nbsp;gets&nbsp;me&nbsp;closer,&nbsp;but&nbsp;some&nbsp;of&nbsp;the&nbsp;transparent&nbsp;areas&nbsp;are&nbsp;still&nbsp;pocked&nbsp;marked&nbsp;with&nbsp;visible&nbsp;white&nbsp;areas.&amp;nbsp;&nbsp;When&nbsp;I&nbsp;view&nbsp;the&nbsp;image&nbsp;transparency&nbsp;in&nbsp;a&nbsp;tool&nbsp;like&nbsp;PaintShopPro&nbsp;or&nbsp;PhotoShop,&nbsp;it&nbsp;looks&nbsp;great.&amp;nbsp;&nbsp;Can&nbsp;you&nbsp;think&nbsp;of&nbsp;anything&nbsp;that&nbsp;might&nbsp;be&nbsp;causing&nbsp;the&nbsp;pocked&nbsp;marked&nbsp;transparency&nbsp;when&nbsp;using&nbsp;Pixbug.AddAlpha?&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
Aaron&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
Here's&nbsp;the&nbsp;current&nbsp;code:&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
//imgCartIcon.Pixbuf&nbsp;=&nbsp;new&nbsp;Gdk.Pixbuf(sCartIconPathFilename);&nbsp;&amp;nbsp;&lt;br&nbsp;/&gt;<br>
Gdk.Pixbuf&nbsp;objPixbuf&nbsp;=&nbsp;new&nbsp;Gdk.Pixbuf(sCartIconPathFilename);&nbsp;&amp;nbsp;&lt;br&nbsp;/&gt;<br>
//&nbsp;need&nbsp;to&nbsp;handle&nbsp;the&nbsp;transparency&lt;br&nbsp;/&gt;<br>
//imgCartIcon.Pixbuf.AddAlpha(true,&nbsp;255,&nbsp;255,&nbsp;255);&lt;br&nbsp;/&gt;<br>
objPixbuf&nbsp;=&nbsp;objPixbuf.AddAlpha(true,&nbsp;255,&nbsp;255,&nbsp;255);&lt;br&nbsp;/&gt;<br>
imgCartIcon.Pixbuf&nbsp;=&nbsp;objPixbuf;&lt;input&nbsp;type=&quot;hidden&quot;&nbsp;id=&quot;gwProxy&quot;&nbsp;/&gt;&lt;radeditorformatted_1&gt;&lt;input&nbsp;type=&quot;hidden&quot;&nbsp;id=&quot;jsProxy&quot;&nbsp;onclick=&quot;jsCall();&quot;&nbsp;/&gt;<br>
&lt;div&nbsp;id=&quot;refHTML&quot;&gt;&lt;/div&gt;<br>
&lt;br&nbsp;/&gt;<br>
&lt;div&nbsp;id=&quot;divSignature&quot;&gt;&lt;/div&gt;<br>
&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
&lt;span&nbsp;style=&quot;font-family:&nbsp;tahoma,arial,sans-serif;&nbsp;font-size:&nbsp;13px;&quot;&gt;&lt;hr&nbsp;width=&quot;100%&quot;&nbsp;size=&quot;2&quot;&nbsp;align=&quot;center&quot;&nbsp;/&gt;<br>
&lt;strong&gt;From&lt;/strong&gt;:&nbsp;&quot;Chris&nbsp;Szikszoy&quot;&nbsp;&amp;lt;chris@szikszoy.com&amp;gt;&lt;br&nbsp;/&gt;<br>
&lt;strong&gt;Sent&lt;/strong&gt;:&nbsp;Wednesday,&nbsp;January&nbsp;20,&nbsp;2010&nbsp;12:12&nbsp;AM&lt;br&nbsp;/&gt;<br>
&lt;strong&gt;To&lt;/strong&gt;:&nbsp;gtk-sharp-list@lists.ximian.com&lt;br&nbsp;/&gt;<br>
&lt;strong&gt;Subject&lt;/strong&gt;:&nbsp;Re:&nbsp;[Gtk-sharp-list]&nbsp;Gtk.Image&nbsp;with&nbsp;transparency&lt;/span&gt;&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
Ratfish&nbsp;wrote:&lt;br&nbsp;/&gt;<br>
&amp;gt;&nbsp;&lt;br&nbsp;/&gt;<br>
&amp;gt;&nbsp;I&nbsp;think&nbsp;it&nbsp;has&nbsp;something&nbsp;to&nbsp;do&nbsp;with&nbsp;the&nbsp;Pixmap&nbsp;of&nbsp;the&nbsp;Gtk.Image,&nbsp;but&nbsp;I&lt;br&nbsp;/&gt;<br>
&amp;gt;&nbsp;can't&nbsp;find&nbsp;any&nbsp;examples.&nbsp;&nbsp;My&nbsp;image&nbsp;has&nbsp;a&nbsp;white&nbsp;color&nbsp;that&nbsp;represents&nbsp;the&lt;br&nbsp;/&gt;<br>
&amp;gt;&nbsp;transparency.&nbsp;&nbsp;Can&nbsp;anyone&nbsp;set&nbsp;me&nbsp;straight?&lt;br&nbsp;/&gt;<br>
&amp;gt;&nbsp;&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
You&nbsp;can&nbsp;do&nbsp;this&nbsp;by&nbsp;specifying&nbsp;the&nbsp;transparent&nbsp;color&nbsp;of&nbsp;the&nbsp;pixbuf.&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
You&nbsp;can&nbsp;use&nbsp;Pixbuf.AddAlpha&nbsp;().&nbsp;&nbsp;This&nbsp;will&nbsp;return&nbsp;a&nbsp;new&nbsp;pixbuf,&nbsp;as&nbsp;specified&lt;br&nbsp;/&gt;<br>
by&nbsp;the&nbsp;gdk&nbsp;docs&nbsp;here:&lt;br&nbsp;/&gt;<br>
http://www.pygtk.org/docs/pygtk/class-gdkpixbuf.html#method-gdkpixbuf--add-alpha&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
I&nbsp;don't&nbsp;think&nbsp;you&nbsp;need&nbsp;to&nbsp;mess&nbsp;with&nbsp;the&nbsp;.Pixmap&nbsp;of&nbsp;the&nbsp;image,&nbsp;just&nbsp;create&nbsp;a&lt;br&nbsp;/&gt;<br>
new&nbsp;pixbuf&nbsp;from&nbsp;the&nbsp;file,&nbsp;add&nbsp;alpha,&nbsp;and&nbsp;assign&nbsp;the&nbsp;resulting&nbsp;pixbuf&nbsp;to&lt;br&nbsp;/&gt;<br>
imgCartIcon.Pixbuf.&lt;br&nbsp;/&gt;<br>
--&nbsp;&lt;br&nbsp;/&gt;<br>
View&nbsp;this&nbsp;message&nbsp;in&nbsp;context:&nbsp;http://old.nabble.com/Gtk.Image-with-transparency-tp27237130p27238075.html&lt;br&nbsp;/&gt;<br>
Sent&nbsp;from&nbsp;the&nbsp;Mono&nbsp;-&nbsp;Gtk#&nbsp;mailing&nbsp;list&nbsp;archive&nbsp;at&nbsp;Nabble.com.&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
_______________________________________________&lt;br&nbsp;/&gt;<br>
Gtk-sharp-list&nbsp;maillist&nbsp;&nbsp;-&nbsp;&nbsp;Gtk-sharp-list@lists.ximian.com&lt;br&nbsp;/&gt;<br>
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list&lt;br&nbsp;/&gt;<br>
&lt;br&nbsp;/&gt;<br>
&lt;input&nbsp;type=&quot;hidden&quot;&nbsp;id=&quot;gwProxy&quot;&nbsp;/&gt;&lt;radeditorformatted_2&gt;&lt;input&nbsp;type=&quot;hidden&quot;&nbsp;id=&quot;jsProxy&quot;&nbsp;onclick=&quot;jsCall();&quot;&nbsp;/&gt;<br>
&lt;div&nbsp;id=&quot;refHTML&quot;&gt;&lt;/div&gt;<br>
&lt;/radeditorformatted_2&gt;&lt;/radeditorformatted_1&gt;&lt;/font&gt;<br>
</tt>