473,698 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bitmap masking the .NET way

Hello there,
Does anyone know how to to Bitmap masking in .NET,
In c++ i used,
CreateCompatibl eDC
GetBitmap

Then on the bitmap and the bitmap mask i called.
{SelectBitmap
StretchBlt}

No I gather i can do this
Bitmap offScreenBmp;
Graphics offScreenDC;
offScreenBmp = new Bitmap(this.Wid th, this.Height);
offScreenDC = Graphics.FromIm age(offScreenBm p);

but how do i load the second bitmap mask somehow to make a transparent bitmap?

thanks in advance
Brian Keating

Nov 16 '05 #1
1 5231
Hello again,
think i've this one sussed.
Bitmap class has a MakeTransparent method this is what i want I should think
thanks for having a look however

regds
Brian Keating

"Brian Keating EI9FXB" wrote:
Hello there,
Does anyone know how to to Bitmap masking in .NET,
In c++ i used,
CreateCompatibl eDC
GetBitmap

Then on the bitmap and the bitmap mask i called.
{SelectBitmap
StretchBlt}

No I gather i can do this
Bitmap offScreenBmp;
Graphics offScreenDC;
offScreenBmp = new Bitmap(this.Wid th, this.Height);
offScreenDC = Graphics.FromIm age(offScreenBm p);

but how do i load the second bitmap mask somehow to make a transparent bitmap?

thanks in advance
Brian Keating

Nov 16 '05 #2

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

Similar topics

2
3954
by: Ginchy | last post by:
I have uploaded a small 3 page web using MS Publisher 2003 and after uploading I switched on url masking to cloak the url. I am certain that it worked fine. I simply changed the colour scheme in Publisher and reuploaded the page. The links no longer work? When I switch off url masking it works as it should?
0
1392
by: Dana Epp | last post by:
I have a ToolBarButton that when I set it to disabled (button.Enabled = false;) causes a really ugly gray masking effect to take place. This is normal and the intended way of the button, but I would like to clean it up. Instead of using the gray mask, I want to use my own grayscaled high quality image. I thought by simply setting button.ImageIndex = new_num; (where new_num is the index of the grayscale image) I could do this. But alas, that...
2
2777
by: James Dean | last post by:
Could anybody tell me the most efficient way to set the bits in a 1Bpp class. I am reading in byte lines of an image. The byte array tells me what what bits are turned on or off.....i do bit masking to get the colour....i can just convert the whole Line byte array to a bitarray.....Also i have trouble about how to set the pointer to point at a bit instead of a byte.....when i lock the the bits i want the pointer pointing at a bit not a...
8
7174
by: James Dean | last post by:
I have 1 bit per pixel information and i have the width and height of this data.Each bit corresponds to a 24 bit colour value. I want to convert this to 24bit per pixel bitmap. Do i need to multiply the width and the height by 24 or just the width?. I tried to multiply the width by 24 but the value is too large?.....what can i do?. The 1bpp data is at resolution 600dpi.....can i just use the set resolution function to change it to 96dpi...
0
1287
by: James Dean | last post by:
I have trouble displaying a bitmap. I have 1bpp information. I also have a command telling me what color i need to set the bytes to when the colour is switched on. The trouble is i do all this but it will not display properly. I convert this to 8bpp information. I set the relevant pixel to for example "255,0,0" for Red.....is this right?....i set the Red byte to 255 and the other two values set to 0. I think the Bitmap data class i am...
6
3756
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: ico.Save(file) 5: file.Close()
7
8239
by: Fir5tSight | last post by:
Hi All, I used the following code in C#: using System.Drawing; //blah blah blah Bitmap bmp = new Bitmap();
9
2266
by: Daniel Smedegaard Buus | last post by:
Hey all :) I was wondering about the $error_types (I particularly notice the 's' suffix when reading the manual) parameter for 'set_error_handler()': Can be used to mask the triggering of the error_handler function just like the error_reporting ini setting controls which errors are shown. Without this mask set the error_handler will be called for every error regardless to the setting of the error_reporting setting.
2
5328
by: meghla | last post by:
I can not understand how to implement bit masking on a c code?? while working with array it is taking too much time.................. so i need help. i need some suggestion and sample code of C dealing with bit masking..............; its argent............. plz help me.
0
8676
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8608
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9164
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8898
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8870
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5860
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3051
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 we have to send another system
3
2006
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.