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