[Tkinter-discuss] How to get DIB into Tkinter frame?

Reiner M. Stoss rstoss at online.de
Fri Sep 1 11:40:11 CEST 2006


> is PaintPicture rendering into a HDC?
> can you get it to render to an ordinary bitmap?

Here is the description of this method from the reference:

PlateDIB.PaintPicture() Method

Copy the DIB bitmap to another using BitBlt.


The method syntax has these parts:

Part Description 
DeviceContext (Long) Handle to a GDI device context
containing the destination bitmap (HDC, Long)
Return (Nothing) Does not return a value. 

Paints the bitmap in the PlateDIB object onto a bitmap
in some other Windows Graphics Device Interface device.
>From Visual Basic, you can paint into a Picture control.
For example, suppose you have a form with a Picture
control on it named picImage, and a PlateDIB object
that has been Create()ed and Render()ed named pdM104: 

pdM104.PaintPicture picImage.handle

I am new to Tkinter so this might be an easy
problem for an expert but it is above my knowledge.
I have lost already days with it :-(

I was even wondering what HDC means. I see in VB
that the PictureBox has a property called "HasDC"
and it works with "m.PaintPicture Picture1.hDC"
but I do not want to use VB at all and do all in
Python/Tkinter. So the VB code snippet was just intended
as a help to understanding the problem.


More information about the Tkinter-discuss mailing list