I use CBitmap::Create Bitmap create a CBitmap object, and sets the bit datas
by CBitmap::SetBit mapBits, but I can not display it on the screen(ie. use
CDC::BitBlt). Thanks in advance.
My codes like:
CBitmap bmp;
bmp.CreateBitma p(50,50,1,24,NU LL); //24 bit colors
bmp.SetBitmapBi ts(bufLen, pBuf); //pBuf points to valid data
CDC dcMem;
dcMem.CreateCom patibleDC(pDC);
dcMem.SelectObj ect(&bmp);
pDC->BitBlt(0,0,50, 50,&dcMem,0,0,S RCCOPY); // fault! can not display the
map. 2 14033
"Jimmy Lu" <lu*****@21cn.c om> wrote in message
news:OK******** ******@TK2MSFTN GP10.phx.gbl... I use CBitmap::Create Bitmap create a CBitmap object, and sets the bit
datas by CBitmap::SetBit mapBits, but I can not display it on the screen(ie. use CDC::BitBlt). Thanks in advance.
My codes like: CBitmap bmp; bmp.CreateBitma p(50,50,1,24,NU LL); //24 bit colors bmp.SetBitmapBi ts(bufLen, pBuf); //pBuf points to valid data CDC dcMem; dcMem.CreateCom patibleDC(pDC); dcMem.SelectObj ect(&bmp); pDC->BitBlt(0,0,50, 50,&dcMem,0,0,S RCCOPY); // fault! can not display
the map.
I'm pretty GDI impaired, so take this with a grain of salt. What I suspect
is that there is some disparity in the 'nBitsPixel' parameter used in your
call to CreateBitmap and the actual bits per pixel of your 'pBuf' data. How
is this buffer filled?
--
Jeff Partch [VC++ MVP]
Hi Jimmy,
You must use a compatible bitmap if you use SetBitmapBits
(CreateCompatib leBitmap). SetBitmapbits is deprecated anyway, you would be
better off working with DIB's if you want to manipulate pixels directly.
Cheers
Doug Forster
"Jimmy Lu" <lu*****@21cn.c om> wrote in message
news:OK******** ******@TK2MSFTN GP10.phx.gbl... I use CBitmap::Create Bitmap create a CBitmap object, and sets the bit
datas by CBitmap::SetBit mapBits, but I can not display it on the screen(ie. use CDC::BitBlt). Thanks in advance.
My codes like: CBitmap bmp; bmp.CreateBitma p(50,50,1,24,NU LL); //24 bit colors bmp.SetBitmapBi ts(bufLen, pBuf); //pBuf points to valid data CDC dcMem; dcMem.CreateCom patibleDC(pDC); dcMem.SelectObj ect(&bmp); pDC->BitBlt(0,0,50, 50,&dcMem,0,0,S RCCOPY); // fault! can not display
the map. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: DraguVaso |
last post by:
Hi,
In the override of the Paint-method of a DataGridTextBoxColumn I want to
show an image with BitBlt, to see what I can gain there on performance.
The problem is: It doesn't show me the image in the DataGrid-Cell's, but a
black background...
Does anybody has any idea what I am doing wrong?
Thanks a lot in advance,
|
by: Michael Murphy |
last post by:
At the risk of being publically humiliated, might I ask the following
simple question.
I have a solution with one project. This project, WindowsApplication1,
has one "form" and one "bitmap" (the bitmap created by right clicking
on the project, selecting add new item, then add bitmap file). The
project explorer says my bitmap is called...
|
by: active |
last post by:
I find Bitmap.Save works for WMF files but Bitmap.FromFile does not.
If I use FromFile on a WMF file that came with VS I get an exception.
If I use it on a WMF file created with Bitmap.Save I don't get an exception
but it appears the Bitmap is blank.
Can anyone share some knowledge on this?
|
by: tjonsek |
last post by:
I get a generic error (not very helpful) when attempting to save a
re-sized image back to its original location. Here is the code snippet:
Dim g As System.Drawing.Image =
System.Drawing.Image.FromFile(Me.File1.Value)
Dim thisFormat = g.RawFormat
Dim imgOutput As New Bitmap(g, 800, 600)
Dim strFileType As String
Dim strFileName As String...
|
by: Jeff |
last post by:
Help!!!
The bitmap I am trying to display in a sample Crystal Report is coming
up with much less quality than the original bitmap.
I have a 300x300 dpi bitmap file that I want to insert at run time into
a Crystal Report. The path to the file is stored in a varchar(100)
field in a table in SQL Server.
The Crystal Report displays the...
| |
by: Smokey Grindel |
last post by:
I have a bitmap object I want to return as a JPEG image with a compression
set at 90% and progressive passes enabled, how can I do this in .NET 2.0?
Progressive passes are not necessary but the compression ratio is.. thanks!
|
by: active |
last post by:
I've been looking on the Internet for a way to convert a DIB to a Bitmap
without success.
Now I'm wondering if that is the approach I should be taking.
All I want to do is display the DIB or draw it into a Bitmap.
Is there a graphics method that can help?
|
by: gudguy |
last post by:
dear gurus,
void CreateBitmap()
{
BITMAPINFO bitmapInfo;
int nBufSize;
BYTE *pbBitmap;
// assuming I have initialized all the variables above, how can I create a System::Drawing::Bitmap from them? Im using mixed-mode in C++/CLI
|
by: =?Utf-8?B?QVRU?= |
last post by:
I have a bitmap of 100X100. On the load, the bitmap is created by a function
(createimage()). On my OnPaint, I draw the image back to the screen
(e.Graphics.DrawImage( bitmap, destrect)).
Now, I want to add a button. When user click on it, I want the bitmap shift
to the left by 10% and fill the new area with new information requested....
|
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...
|
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. ...
| |
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
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...
| |