473,692 Members | 2,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert inmemory bitmap nach png mit transparent farbe

Hallo!

Ich habe eine inmemory-bitmap. die ich leider in eine png-datei umwandeln
muss.

ich mache das jetzzt so:

b = New
Bitmap(System.R eflection.Assem bly.GetExecutin gAssembly.GetMa nifestResourceS tream(sFullName ))
If b Is Nothing Then
Return ""
End If
sFileName = SS.AppShared.Ge tTempFileWithAu toDelete("png")
b.Save(sFileNam e, System.Drawing. Imaging.ImageFo rmat.Png)

Leider gibts so keine transparentfarb e.
Kann man irgendwie dafür sorgen, das das Pixel auf 0,0 als transparentfarb e
verwendet wird?

Gruss Wolfgang
Aug 10 '06 #1
2 2526
"Wolfgang Hauer" <ha***@DELETETH ATsysdat.atschr ieb:
b = New
Bitmap(System.R eflection.Assem bly.GetExecutin gAssembly.GetMa nifestResourceS tream(sFullName ))
If b Is Nothing Then
Return ""
End If
sFileName = SS.AppShared.Ge tTempFileWithAu toDelete("png")
b.Save(sFileNam e, System.Drawing. Imaging.ImageFo rmat.Png)

Leider gibts so keine transparentfarb e.
Kann man irgendwie dafür sorgen, das das Pixel auf 0,0 als
transparentfarb e verwendet wird?
Check out the 'MakeTransparen t' method of the 'Bitmap' object.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Aug 10 '06 #2
Perfekt, danke dir.

Wolfgang

PS: Man sollte halt suchen und lesen können!

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.atschri eb im Newsbeitrag
news:uv******** ******@TK2MSFTN GP06.phx.gbl...
"Wolfgang Hauer" <ha***@DELETETH ATsysdat.atschr ieb:
>b = New
Bitmap(System. Reflection.Asse mbly.GetExecuti ngAssembly.GetM anifestResource Stream(sFullNam e))
If b Is Nothing Then
Return ""
End If
sFileName = SS.AppShared.Ge tTempFileWithAu toDelete("png")
b.Save(sFileNa me, System.Drawing. Imaging.ImageFo rmat.Png)

Leider gibts so keine transparentfarb e.
Kann man irgendwie dafür sorgen, das das Pixel auf 0,0 als
transparentfar be verwendet wird?

Check out the 'MakeTransparen t' method of the 'Bitmap' object.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Aug 10 '06 #3

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

Similar topics

0
1858
by: James Dean | last post by:
I am drawing to an offscreen bitmap various shapes and so on. I have created a bitmap for this purpose. But the bitmap has a black background so i used the make transparent method to clear the background. But i use scroll bars if the image is too big for the client area. When i scroll down the screen cannot redraw itself correctly. If i dont use the transparent method and the background is black it does not do this. I saw in the...
7
3583
by: Peter Oliphant | last post by:
Using MakeTransparent one can supposedly turn a color used in a Bitmap to transparent. But, it looks to me like all it does it set these pixels to the color BackColor of the Control it's attached to. Thus, when I set White to the transparent color of a Bitmap stored in the Image of a PictureBox and placed the PictureBox on a Form which has a BackColor of black, it turned the white pixels of the bitmap image to black, but these black pixels...
2
2217
by: Jax | last post by:
So far i've not had much luck with this method. Bitmap.MakeTransparent(someColor); Makes the transparent colour either a non-transparent black (.bmp, jpg or .gif) or silver (.png) i've tried another solution with system.drawing making the selected color have a zero alpha setting (in the palette) but when the image is re-uploaded (saved as .gif) it shows no transparency. Does anyone else have any experience in doing this in ASP.NET, if so what...
6
3754
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()
2
2332
by: Carl Gilbert | last post by:
Hi I have to following code which sets up a new bitmap. 'set up a transparent 16x16 bitmap Dim bm As New Bitmap(16, 16) Dim g As Graphics = Graphics.FromImage(bm) g.Clear(System.Drawing.Color.Transparent) 'draw a rectangle on the transparent bitmap
3
4092
by: Dennis | last post by:
I have a bitmap and make the color transparent; mybitmap.MakeTransparent(Color.Black) When I save it as a Icon, the black color is not transparent. However, if I save it as a bitmap then display it using windows explorer, the black color is in fact transparent. Could it be that the bitmap is not an alpha bitmap that causes the icon to not have the black color transparent? --
2
7525
by: Sharon | last post by:
Hello Experts, I'm creating a bitmap object like this: Bitmap myImage = new Bitmap(1024, 1024, System.Drawing.Imaging.PixelFormat.Format24bppRgb); But when I invoking the function myImage .MakeTransparent() (with or without parameters), the myImage.PixelFormat changes to Format32bppArgb. Why is that and how can I avoid it but still making the Bitmap transparent ?
5
23898
by: Dale | last post by:
When I create a System.Drawing.Bitmap and save it as ImageType.GIF, how can I set the transparency so that the background is transparent. In my application, the Bitmap that I am working with has several transparent GIFs drawn on it and the transparency of each of them works within the bitmap, but the bitmap overall gets saved with a black background. Any help is greatly appreciated.
8
3762
by: Hrungdak | last post by:
Hi all I am new here and i hope i do not make any mistakes with this question. I try to change a GIF-File that contains transparency. The problem lies within the following code: ' Open a gif with transparency Dim nBm As Bitmap = New Bitmap("C:\Temp\TestTransparent.gif") ' Create a new bitmap with the same size
0
8604
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
8538
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
8801
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
7627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5819
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();...
0
4324
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4557
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2974
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
2
2238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.