Draw texture2d ?

I am ambiguous… on drawing 2d image
I read that aspect2d will do it.
I loaded png image from file to PNMImage object. Now I want to add image to aspect2d. I guess using Nodepath. If it’s right, what should I do?
Or not, how to draw 2d image in Panda3d ?

Oh, I resolved this!

HI there
That exactly what i want to do.I am trying to draw 2D image.But i have no idea about that.I have only tried to draw some normal image using an image processing tool.But my image tool doesn’t support to draw 2d image directly.I just want to know that if there is any powerful image tool which supports to do that direcly.Thanks for any suggestions.

I presume that you’re talking about drawing an image to the screen, rather than drawing to an image? If so, then I don’t know about drawing directly to the screen, but in Panda you should be able to put a 2D image onto the screen by applying it to a 2D card (scaled by getting the image’s width and height; see below), then parenting that to pixel2d and placing it appropriately (bearing in mind the position of pixel2d’s origin and the signs of its axes – in particular note that pixel2d’s y-axis advances on-screen from 0 to increasingly negative values).

Getting an images width and height:

# Presume that you have the name of your image file in a variable named "fileName"

# Don't forget to import PNMImageHeader and Filename!
header = PNMImageHeader() 
header.readHeader(Filename(fileName))
xSize = header.getXSize()
ySize = header.getYSize()

[edit]
Sorry, I missed that this was in the C++ section; I imagine that similar mechanisms exist on the C++ side, however.

Use CardMaker to create a card. But I believe you can just pass a texture to load_model and it’ll return an actual card. You can put that in the scene graph of your choice.