473,748 Members | 7,377 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bitmap.MakeTran sparent problem

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 bitmap.drawback ground method that it does not recognize
transparent bitmaps.......h ow do i solve this problem to redraw the
screen correctly when scrolling through a transparent bitmap....here is
the method for scrolling event.

private void HandleScroll(Ob ject sender, ScrollEventArgs se)
{
/* Create a graphics object and draw a portion
_canvasGraphics = pictureBox1.Cre ateGraphics();
_canvasGraphics .DrawImage(_can vasImage,
new Rectangle(0, 0, pictureBox1.Rig ht - vScrollBar1.Wid th,
pictureBox1.Bot tom - hScrollBar1.Hei ght),
new Rectangle(hScro llBar1.Value, vScrollBar1.Val ue,
pictureBox1.Rig ht - vScrollBar1.Wid th,
pictureBox1.Bot tom - hScrollBar1.Hei ght),
GraphicsUnit.Pi xel);
pictureBox1.Upd ate();
}

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
0 1859

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

Similar topics

2
2925
by: Jax | last post by:
Whenever I use this method I get out of memory exception, even when using tiny bitmaps (100X100) Does anyone know why this is From what I remember OutOfMemory Exception is a default for other exceptions, does anyone know what it might be I am of course using try catch and finally blocks to ensure in cases of exceptions resources get released, I just can't understand why i'm always getting this exception Help me people of the newsgroups,...
2
19499
by: blackegg | last post by:
How to set Bitmap background to transparent *-----------------------* Posted at: www.GroupSrv.com *-----------------------*
1
5242
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}
2
2220
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...
2
429
by: Dennis | last post by:
I have created a bitmap and set the transparency color to black; mybitmap.MakeTransparent(Color.Black) myicon = Icon.FromHandle(bm.GetHicon) This creates the icon ok but the background color black is not transparent. How do I create an Icon from this bitmap that has also the color black transparent?
2
7532
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 ?
0
2961
by: BIG_j | last post by:
I have dynamic image(s) on the clipboard that I need to save as a transparent gif. There are a number of posts regarding MakeTransparent but I cannot get this to work for what I am trying to do. I am NOT loading the picture into a form and there are no paint events to consider. I am simply loading the image from the clipboard and saving it to a file. Anyone have a solution or workaround?? Here is the code snippet...
5
23913
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.
0
2881
by: benfly08 | last post by:
Hi, guys. I have a program to draw bar/pie chart based on the data i hard coded in it. However, my image comes with "BLACK" background color. I don't know how to fix this. The code snippet is below: chartGenerator.vb class: Imports System.Drawing.Imaging Public Class chartGenerator Private myImage As Bitmap
0
8989
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
8828
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
9367
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...
0
9243
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...
1
6795
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4599
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...
1
3309
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
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2213
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.