473,508 Members | 2,088 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 5835
> 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
2291
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...
6
3735
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: ...
0
1067
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...
0
1231
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...
15
1810
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
7808
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...
5
3583
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...
1
1508
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
2866
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...
20
6969
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...
0
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
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,...
0
7388
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...
1
7049
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...
0
7499
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...
0
3199
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...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1561
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
422
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...

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.