473,587 Members | 2,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PyGTk - Drawing onto an Image - not using deprecated functions what is best method?

2 New Member
using PyGtk - no problems.
I can draw onto an Image using a PixBuf, Drawable etc

pixbuf = image.get_pixbu f()
drawable = pixbuf.render_p ixmap_and_mask( )[0]
drawable.draw_l ine(drawable.ne w_gc(),10,20,10 0,120)
pixbuf.get_from _drawable(drawa ble,cmap,0,0,0, 0,100,120

However...
if I read about render_pixmap_a nd_mask I am told..
"...a convenience method; applications that need to render pixbufs with dither offsets or to specific drawables should use the render_to_drawa ble_alpha() or render_to_drawa ble() methods..."

and if I read about render_to_drawa ble I am told...
"This method is deprecated in PyGTK 2.2 and above. Use the gtk.gdk.Drawabl e.draw_pixbuf() method instead."

so do I presume I should not use "render_pixmap_ and_mask"?

but I can not find any other way documented to do this?
Trying to get it to work I just can not get a Drawable and a graphics_contex t to give me what I want and I keep going round in circles trying to make this work without using the apparently deprecated functions...

I would be most grateful if someone could show me the best way to correctly handle this so I can draw on an Image.
...or is "render_pixmap_ and_mask" guaranteed for the future?

thanks for any info - and Merry Christmas All

nick
Oxford
Dec 24 '10 #1
0 1397

Sign in to post your reply or Sign up for a free account.

Similar topics

13
31753
by: Mike | last post by:
We are using: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> Using CSS (not html since align=center and <center> are deprecated) I can get it to work in IE6 (but not NS 7 or Firefox) with. <div...
3
5804
by: Alberto | last post by:
I'm drawing an image in a panel control with this sentence in the Paint method: e.Graphics.DrawImageUnscaled(Image, panelImage.AutoScrollPosition); The problem is that I only want to paint a region of the image specified by a Rectangle object. I can do it with: e.Graphics.DrawImageUnscaled(Imagen, myRectangle);
0
1212
by: Craig | last post by:
hello, I am drawing an image on a Control which has a shadow to it using the DrawImage method (taking the image and x,y co ords) when I place that control on my form the shadow is somewhat distorted and I cannot see the image as I would see it, if it was placed in a pictureBox
1
16222
by: Prasad More | last post by:
Hello, I am trying to write a text on Multi-page TIFF image using C# and .NET GDI+. I have written following code to do this. When I execute this code I get "Invalid Parameter User. at System.Drawing.Image.Save" error. public void addAnnotationStampOnImage() { string strStamp = Path.GetFileNameWithoutExtension(_ImageFileName); Size dSize;...
6
2728
by: guassian | last post by:
Hi, I am new to C programming. Is there way to read a 8 bit gray image using C language? Thanks and best regrads, Raj
3
20069
by: Senthil | last post by:
Hi all I'm new in ajax. How to upload a image using ajax..
2
3770
by: user | last post by:
Hi all... i am trying to print an image using GDI - but the only thing i get is a black rectangle. Does anybody know what is wrong, or how else to get the bitmap on the printer (GDI+ is not possible. it is a POS printer (for restaurants) and the printer internal fonts are a MUST for printing speed. as far as i know printer internal fonts...
3
8507
by: R.A.F. | last post by:
Hi, From C++ world, i'm used to have a cpp file, where i placed all common functions that i could need within different projects. something like my own "API". i would like to do something similar under C# but if i create a namespace, automatically i must after create a class, enum or struct for example.
1
1917
by: helraizer1 | last post by:
Hi folks, I have an image based shoutbox which I am currently implementing emoticons onto. I have a way now for the emoticons to appear where the :D or =) etc. is on the image, but for some reason they seem to be conflicting. I shall try to explain. chatbox.php - only necessary code shown $grins = array('=D', "=d", ":d", ":D"); ...
1
3042
by: Nilla2010 | last post by:
Hi, How to save the drawing (contents) on a panel as an image using C# and asp.net.I found Panel1.DrawToBitmap but its not working in the asp.net ,is there any assembly i am missing or the function is altogether different ? Thanks
0
8206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.