473,395 Members | 1,931 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Can i get bytes from DC directly?

Here i use BitBlt(destDC,x,y,w,h,srcDC,x,y,SRCCOPY) to copy srcDC into
destDC.

i think GetPixel(destDC,x,y) can get the Pixel info at Point(x,y).

and my question is :

can i get bytes info from destDC directly ?

because i think get bytes directly is faster than GetPixel()'s way.

why do i bring out this question?
i have read a msdn help 'How to save a true color bitmap into a Gif file'
which tells me how to get the pixelinfo and save the bitmap into a gif
file.And the help says while doing pixels processing,the LockBits() method
is more efficent than GetPixel()'s way.
so i think whether there is a way to get bytes info from DC directly like
LockBits() do.
Nov 16 '05 #1
1 1061

If you need speed then you should pin the memory and use a pointer
in an unsafe code block. Bob Powell has a nice website about GDI+ and
this should get your going http://www.bobpowell.net/lockingbits.htm

HTH,

//Andreas

"΢ÈíÐÂÎÅ×é" <fp*****@163.net> skrev i meddelandet
news:O2**************@TK2MSFTNGP12.phx.gbl...
Here i use BitBlt(destDC,x,y,w,h,srcDC,x,y,SRCCOPY) to copy srcDC into
destDC.

i think GetPixel(destDC,x,y) can get the Pixel info at Point(x,y).

and my question is :

can i get bytes info from destDC directly ?

because i think get bytes directly is faster than GetPixel()'s way.

why do i bring out this question?
i have read a msdn help 'How to save a true color bitmap into a Gif file'
which tells me how to get the pixelinfo and save the bitmap into a gif
file.And the help says while doing pixels processing,the LockBits() method
is more efficent than GetPixel()'s way.
so i think whether there is a way to get bytes info from DC directly like
LockBits() do.

Nov 16 '05 #2

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

Similar topics

2
by: pbay | last post by:
Hi everyone, I'm experiencing a problem with PHP that doesn't seem to have any documentation related to it. I hope it's a simple error on my part :) Basically, I'm loading a SWF (Macromedia...
12
by: Axel | last post by:
Hiho, I want to read the content of a binary file into a string. It works, but only the first 4 chars are left after the reading and the stringsize is, of course, 4 bytes. I got this method...
9
by: cylin | last post by:
Dear all, Using sizeof(vector<TYPE>) will always return 16 bytes. If I have N elements ( integer ), the total memory is sizeof(vector<int>)+sizeof(int)*N, or sizeof(vector<int>)*N, or others?...
19
by: Lorenzo J. Lucchini | last post by:
My code contains this declaration: : typedef union { : word Word; : struct { : byte Low; : byte High; : } Bytes; : } reg;
12
by: Olaf Baeyens | last post by:
I am porting some of my buffer class code for C++ to C#. This C++ class allocates a block of memory using m_pBuffer=new BYTE; But since the class is also used for pointers for funtions that uses...
10
by: shaji | last post by:
Hi, Could anybody tell me how to access the individual bytes that consists of a Windows LONGLONG value?
9
by: onkar | last post by:
how many bytes will be allocted by following code - #include<stdio.h> #define MAXROW 3 #define MAXCOL 4 int main(int argc,char **argv){ int (*p); p=(int (*))malloc(sizeof(*p)*MAXROW);...
16
by: Christian Heimes | last post by:
Gabriel Genellina schrieb: Yes, it's on purpose but it's a bug in your application to call str() on a bytes object or to compare bytes and unicode directly. Several months ago I added a bytes...
6
by: ssubbarayan | last post by:
Dear all, I developed the following program: void parsebytes(unsigned char* data); struct info { unsigned char day; unsigned char month; short year;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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...
0
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,...

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.