Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9272747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:56:28+00:00 2026-06-18T15:56:28+00:00

I have an image drawn using PIL in python. import Image import ImageDraw createCM():

  • 0

I have an image drawn using PIL in python.

import Image
import ImageDraw
createCM():
   img = Image.new("RGB", (400,400), "white")
   draw = ImageDraw.Draw(img)

   coords = [(100,70), (220, 310), (200,200)]
   dotSize = 2

   for (x,y) in coords:
       draw.rectangle([x,y,x+dotSize-1,y+dotSize-1], fill="black")

Want i want to do now is show this on my wxpython panel.

I started off like this

CMchart = createCM(self)
self.vbox = wxBoxSizer(wx.VERTICAL)
self.vbox.Add(CMchart, 1, wx.LEFT | wx.TOP | wx.GROW)
self.vbox.AddSpacer(25)
self.SetSizer(self.vbox)
self.vbox.Fit(self)

This does’t show anything. Just want to know where I am going wrong

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:56:29+00:00Added an answer on June 18, 2026 at 3:56 pm

    without knowing what createcM does it is really difficult to know how to help you. But the short of it is that to draw an Image you load the data from a wx.Image turn it into a wx.Bitmap and then draw it using a DeviceContext. Typically first draw it a wx.MemoryDC first the when you have finished all your drawing updates you then use a wx.PaintDC or a wx.ClientDC to draw it. Take a look it

    http://wiki.wxpython.org/WorkingWithImages#PIL_.28Python_Imaging_Library.29

    which gives you a good example of how to load images from PIL

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a image that I created using PIL import Image import ImageDraw img
Here's the code I'm using: from PIL import Image import ImageFont, ImageDraw import sys
I have a raw image buffer in the RGB format. I need to draw
I have an image i.e. drawn using Windows GDI calls (24 bpp) and I
I have drawn an image on a Composite using the following code imageCanvas =
I have a drawn an image using Raphael framework. It is an SVG image.
I have drawn Image on a custom control. But whenever I draw another Image
I have a python script that is writing text to images using the PIL.
I have an HTML5 canvas image where I've drawn some points and I want
I have class where I draw image. This is code: public class CanvasdrawActivity extends

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.