Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I use CachedBitmap in C#

Posted on 2004-04-13
3
Medium Priority
?
1,625 Views
Last Modified: 2012-06-22
I'm fairly new to the Visual Studio .NET environment. I'm pretty much still used to Visual C++ 6.0. However, I'm trying to develop a small Windows Control Class that simply paints a bitmap on the control. My problem is using the CachedBitmap class. Whenever I instantiate a CachedBitmap variable, I get a message in my Task List saying : "The type or namespace name 'CachedBitmap' could not be found...

Obviously I need to import the appropriate libraries. in VC++ I would use the #include directive. It seems I need to use the Using directive for C#, but I don't seem to get this right.

All I want to know is what I need to do to be able to use the CachedBitmap class in my C# solution.

Kind regards
Josamoto
0
Comment
Question by:josamoto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Expert Comment

by:caner_elci
ID: 10818608
CachedBitmap is a GDI+ class which is not wrapped in .NET's System.Drawing.. You don't need to use it anyway, try Bitmap instead...
0
 
LVL 4

Accepted Solution

by:
caner_elci earned 250 total points
ID: 10818647
If you need information about System.Drawing.Bitmap, you can use the following constructor:

public Bitmap(
   int width,
   int height,
   PixelFormat format
);

and you can use Format32bppPArgb as PixelFormat for your needs.. Just like:

Bitmap myBitmap = new Bitmap( 800, 600, PixelFormat.Format32bppPArgb );

then you can get a Graphics for this bitmap:

Graphics g = Graphics.FromImage( myBitmap );

now, anything you draw on g will be drawn on myBitmap..
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 10818992
Hi

Read this
=============
Fred_MS:
Q: rkp123 : CachedBitmap? Anybody?

Fred_MS:
A: We don't have a CachedBitmap. However, if you render to the Form (within OnPaint()) we will automatically render to a cached bitmap then bitblt forward.

http://msdn.microsoft.com/chats/vstudio/vstudio_090302.asp
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question