473,569 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to show a bitmap?

Hi,
I have a two dimentional array (by Numeric Python) available, and it
represent a grayscaled bitmap picture. How to display it? Thank you!
Yun
Jul 18 '05 #1
5 5843
> I have a two dimentional array (by Numeric Python) available, and it
represent a grayscaled bitmap picture. How to display it? Thank you!


You can use pygame.

Diez
Jul 18 '05 #2
Could you please be a little more specific? ;)

Yun
On Mon, 1 Dec 2003, Diez B. Roggisch wrote:
I have a two dimentional array (by Numeric Python) available, and it
represent a grayscaled bitmap picture. How to display it? Thank you!


You can use pygame.

Diez


Jul 18 '05 #3
Yun Mao wrote:
Could you please be a little more specific? ;)


Its well documented on www.pygame.org. You have to look into the module
surfarray, which makes it possible to access and manipulate pixel data
using - guess what - Numeric arrays.

Look in the code examples for some effects that utilize this - AFAIK there
is something like a fire or motion blurring. These access pixel data. Just
plug in your array, and you should be done.

Regards, Diez
Jul 18 '05 #4
> Look in the code examples for some effects that utilize this - AFAIK there
is something like a fire or motion blurring. These access pixel data. Just
plug in your array, and you should be done.


http://www.pygame.org/pcr/numpy_flames/index.php

This is the flames example. The function in question is blit_array - look it
up in the docs. This example even deals with indexed_bitmap_ data, which is
what you want, as you have a only one value per pixel.

Regards,

Diez
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2294
by: Erwin | last post by:
At the moment I'm using a report which contains an indicator to show if a Service group of the company isn't working well or is working perfectly. This indicator is a "*" which looks like a traffic light. Example: When a Service groep does hit the target, the indicator will lit up using the following Control Source: =IIf(>0,8*10*;"*") ...
6
3741
by: Lespaul36 | last post by:
From what I have read, there isn't really a converter to icon format..it becomes a png file. I tried: 1: Dim bmp As Bitmap = CType(Bitmap.FromFile("C:\myfolder\file.bmp"), Bitmap) 2: Dim ico As Icon = Icon.FromHandle(bmp.GetHicon()) 3: Dim file As FileStream = New FileStream("C:\myfolder\file.ico",FileMode.OpenOrCreate) 4: ...
0
1077
by: chuck rudolph | last post by:
Depending on the program that does the copy, my c# program can not get the bitmap data off the clipboard. The code used to get the data is: IDataObject o = Clipboard.GetDataObject(); if (o.GetDataPresent(typeof(Bitmap))) { Bitmap bm = (Bitmap)o.GetData(typeof(Bitmap)); if (bm != null) { this.pictureBox1.Image = bm;
0
1244
by: AlVis1515 | last post by:
We had a VB6 program that was used to take a scanned signature image as a set of screen coordinates. The VB6 program then converted this into a bitmap file which we used to embed the signature in certain documents such as invoices. The code was recently ported to VB.NET. We are using the BitMap and DataPoint objects to convert the data to...
15
1821
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
1
7813
by: Smokey Grindel | last post by:
I have a bitmap object I want to return as a JPEG image with a compression set at 90% and progressive passes enabled, how can I do this in .NET 2.0? Progressive passes are not necessary but the compression ratio is.. thanks!
5
3586
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello, I'm using a control (black box control) in my form (an ActiveX/Com control). and I need to take the control as an image. The controls is showing some kind of graph, and I want to create a bitmap file out of this control, so the bitmap will show what the control is showing. I tried this:...
1
1514
by: damini018 | last post by:
hi!! i want to read and show bitmap files in a text pad in binary mode. i want to use c for the code.
4
2870
by: Martijn Mulder | last post by:
When I zoom in on an image, GDI+ automatically smoothens the edges between the pixels. I am looking for a way to see the individual pixels as squares in the enlarged image, like in MSPaint. I searched in vain in the enumerations System.Drawing.Drawing2D.SmoothingMode and System.Drawing.Drawing2D.InterpolationMode to find the constant that...
20
6983
by: Joe Duchtel | last post by:
Hello - I have the following code to get a bitmap from the clipboard and to save it to a *.png file ... Dim lData As IDataObject = Clipboard.GetDataObject() If lData.GetDataPresent(DataFormats.Bitmap) Then Dim lPictureBox As New PictureBox
0
7926
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
8138
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...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
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...
1
5514
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
5223
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
3657
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...
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.