473,405 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Bitmap and mask

Hi everybody !
I am triyng to set a mask on my bmp image with this code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. bmpHome = wx.Bitmap('btn_home.bmp',wx.BITMAP_TYPE_BMP)
  3. bmpHome = bmpHome.SetWidth(18)
  4. mask = wx.Mask(bmpHome, wx.WHITE)
  5. bmpHome = bmpHome.SetMask(mask)
  6.  
So I received this error message:
ValueError: invalid null reference in method 'new_Mask', expected argument 1 of type 'wxBitmap const &'
Can you help me please
Aug 30 '07 #1
3 2344
bartonc
6,596 Expert 4TB
Hi everybody !
I am triyng to set a mask on my bmp image with this code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. bmpHome = wx.Bitmap('btn_home.bmp',wx.BITMAP_TYPE_BMP)
  3. bmpHome = bmpHome.SetWidth(18)
  4. mask = wx.Mask(bmpHome, wx.WHITE)
  5. bmpHome = bmpHome.SetMask(mask)
  6.  
So I received this error message:


Can you help me please
On lines #2 & #4, you re-assign to the variable bmpHome. Don't do that.
Expand|Select|Wrap|Line Numbers
  1.  
  2. bmpHome = wx.Bitmap('btn_home.bmp',wx.BITMAP_TYPE_BMP)
  3. bmpHome.SetWidth(18)
  4. mask = wx.Mask(bmpHome, wx.WHITE)
  5. bmpHome.SetMask(mask)
  6.  
Aug 30 '07 #2
Thank you, now it work fine !
Aug 31 '07 #3
bartonc
6,596 Expert 4TB
Thank you, now it work fine !
You are welcome. Thank you for the update (we like to know if we are being helpful!).
Aug 31 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Gandalf | last post by:
Hi Gurus! Here is a problem with wxPython. I would like to load bitmaps and create a mask for them at once. Here is my idea: the mask colour for the bitmap should be the colour of the pixel in...
12
by: BC | last post by:
Hello, We are creating an Office add-in. We are able to display the add-in successfully. However, we followed a sample program, and it displays a FaceID = 1044 (which is not the bitmap of the...
1
by: Brian Keating EI9FXB | last post by:
Hello there, Does anyone know how to to Bitmap masking in .NET, In c++ i used, CreateCompatibleDC GetBitmap Then on the bitmap and the bitmap mask i called. {SelectBitmap StretchBlt}
6
by: Crirus | last post by:
Strange behaviour: I havea bitmap that I draw and add to an array of bitmaps... Do I have to create a bitmap using New every time? I tried to draw the bitmap in a for loop alike this: Dim...
6
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
by: news.microsoft.com | last post by:
Hi guys, This text looks long and complicate but it is not, and I really really need some help here. For the last 24hs I'm trying to resolve this issue (last night I dreamed
8
by: Frank | last post by:
Given a bitmap I want to write a Icon file using it. I believe I can do it except for writing the bits of the image. Can you tell me how to get the bits into a ByteArray Thanks
1
by: SMALLp | last post by:
Hello everyone! First I want to apologize for asking question about wxPython on this group. I'm doing project that uses wx.ScrolledPanel few wx.Bitmap on it. It all looks wonderful on Ubuntu...
9
Thekid
by: Thekid | last post by:
I want to take a simple bitmap which has 6 horizontal lines of color in it like this: red blue green red blue green I want to move the lines of colors around like this: red red
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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
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
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...

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.