473,654 Members | 3,062 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting error when creating a bitmap for Mappoint map image

I am trying to plot my pushpins manually, but when I go to create the
bitmap, I get an error message. Has anyone gotten this message
before?

code:
MapImage[] mapImages = render.GetMap(m apSpec);
MapImage mi = new MapImage();
mi = mapImages[0];

Bitmap newBitmap = new Bitmap(800, 600);
Graphics graphics = Graphics.FromIm age(newBitmap);
Bitmap mapBitmap = new Bitmap(new
System.IO.Memor yStream(mi.Mime Data.Bits));

I get error message when the bitmap line that says:
Object reference not set to an instance of an object.

Oct 22 '07 #1
1 2864
Well, it's one of three things, it's either mi, the MimeData property on
mi, or the BitsProperty on the return value of the MimeData property on mi.
Have you looked in the debugger to see which it is?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

<am***********@ hotmail.comwrot e in message
news:11******** **************@ v23g2000prn.goo glegroups.com.. .
>I am trying to plot my pushpins manually, but when I go to create the
bitmap, I get an error message. Has anyone gotten this message
before?

code:
MapImage[] mapImages = render.GetMap(m apSpec);
MapImage mi = new MapImage();
mi = mapImages[0];

Bitmap newBitmap = new Bitmap(800, 600);
Graphics graphics = Graphics.FromIm age(newBitmap);
Bitmap mapBitmap = new Bitmap(new
System.IO.Memor yStream(mi.Mime Data.Bits));

I get error message when the bitmap line that says:
Object reference not set to an instance of an object.

Oct 22 '07 #2

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

Similar topics

4
48210
by: Michael Kennedy [UB] | last post by:
Hi Everyone, I have this multithreaded C# windows forms application which does a lot of image processing. Occasionally, I get the following error: A generic error occurred in GDI+. System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
6
2125
by: CoreyMas | last post by:
Hello All, Here is what I would like to do I am creating a game program that displays a map (preferably in hexes but that is another matter) and whenever the user is over the "map" I want to know the x,y coords (in pixels) of where he is pointing to. Here is what I have done
9
6044
by: Sharon | last post by:
I'm trying to convert an Image file to a byte array . Later in my code I'm trying to create a new Image from this byte array as a restored Image. But when I try to save the restored Image to a Bitmap file I get a generic DGI exception saying: "A generic error occurred in GDI+". Here is the code I'm using: ////// Loading a bitmap file to a byte array ////////////////////////
3
3076
by: Hitesh | last post by:
Hi, I am getting the response from another Website by using the HttpHandler in my current site. I am getting the page but all the images on that page are not appearing only placeholder are displayed. Can anybody know this issue and help me to resolve this. In past i received the response saying that i should download the image first and then parse the actual response and modify the src attribute of the
15
5331
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the path of the uploaded image, and resize it with the provided dimensions. My function is below. The current function is returning an error when run from the upload function: A generic error occurred in GDI+. Not sure what exactly that means. From what...
3
1761
by: Dave | last post by:
Hey all, I have a problem and I can't find anything on the net to really address it. We have a program at work that has lots of numbers on the front of the form because it is a control program for a hydro plant. My boss would like me to create a web page so our control center can see all of the numbers but not have access to the actual form. Some of these numbers are gathered every second, others every five seconds and still others...
4
2748
by: tshad | last post by:
I am trying to set up an Image authorization where you type in the value that is in a picture to log on to our site. I found a program that is supposed to do it, but it doesn't seem to work. It should put a blue and yellow box on the page with "This is a test" as part of the picture. But what I get is a broken Gif. The other problem is that I can't view the source???? The view source is disabled for this page. What causes this?
7
8236
by: Fir5tSight | last post by:
Hi All, I used the following code in C#: using System.Drawing; //blah blah blah Bitmap bmp = new Bitmap();
0
2602
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
0
8376
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
8290
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
8815
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...
1
8489
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
8594
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
7307
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...
1
6161
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...
1
2716
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
1
1916
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.