|
But I am doing the same thing in MFC application as I have shown and i got the result then what is the problem here.
Ashish Bhatt
|
|
|
|
|
ashishbhatt wrote: // Capture screen into bitmap
BOOL blitok = BitBlt(
m_hmemdc, rect.left - m_bmrect.left ,
rect.top - m_bmrect.top ,
rect.right - rect.left,
rect.bottom - rect.top,
m_hrootdc,
rect.left, rect.top,
SRCCOPY);
Every thing seems to be fine. But can you tell me or verify what will be position values passed to BitBlt() function like
rect.left - m_bmrect.left , rect.top - m_bmrect.top etc.
|
|
|
|
|
Ya thanks.
here everything comes right somthing like 0,0 position and 1280,1024 position.
I hope problem is not in these value. Plz check the compatibleBitmap() and also SelectObject() function and ma I passing right bitmap handle or not.
Ashish Bhatt
|
|
|
|
|
Ok,So as you told to try GetDIBits(), I used it but I don't get the result.
I modified the original code as below.....
<br />
BYTE* lpClrData = (BYTE*)LocalAlloc(LPTR, datasize * sizeof(BYTE));<br />
<br />
if(GetDIBits(m_hmemdc,new_Bitmap,rect.right - rect.left,<br />
rect.bottom - rect.top,lpClrData,&m_bminfo.bmi,DIB_RGB_COLORS) == 0)<br />
{<br />
MessageBox(NULL,CString("Failed to get Bits from DIB"),CString("TestRTMP"),0);<br />
} <br />
Above function always return zero.So I don't get the ouotput.
Is there any other thing which I am missing in this code plz suggest me.
Thanks.
Ashish Bhatt
|
|
|
|
|
ashishbhatt wrote: datasize = GetBitmapBits(temp_Bitmap,datasize * sizeof(COLORREF), lpClrData);
Here lies the problem
you are calling GetBitmapBits() with temp_Bitmap instead of new_Bitmap .
|
|
|
|
|
Ya, Thanks.
But Now I am getting little much strange problem.Let me explain little much more abt my application.In my application the function in which this bitmap capture is available calls very frequently with diff diff rectangle position.
Now my problem is that at first rectangle data doesn't come(means I checked color value from the buffer it is black color for every pixel)but from second time it comes the data comes right. Every time data comes right aftere every one rectangle.
I hope it very silly mistake but i am not getting it Here I write code from which I print the Pixel values using setpixel.
<br />
<br />
unsigned char *destData = new unsigned char[iWidth*iHeight*sizeof(unsigned char *)] ;<br />
unsigned char *srcColor = new unsigned char[iWidth*iHeight*sizeof(unsigned char *)] ;<br />
int color = 0;<br />
<br />
for(int x = iHeight - 1; x >= 0; x--)<br />
{<br />
for(int y = 0; y < iWidth; y++)<br />
{<br />
<br />
srcColor[color++] = GetRValue(lpClrData[iWidth* x + y]);<br />
srcColor[color++] = GetGValue(lpClrData[iWidth* x + y]);<br />
srcColor[color++] = GetBValue(lpClrData[iWidth* x + y]);<br />
<br />
::SetPixel(m_hrootdc,x ,y ,RGB(srcColor[color-3],srcColor[color-2],srcColor[color-1])); <br />
<br />
}<br />
}<br />
<br />
Ashish Bhatt
|
|
|
|
|
SIR,
Can u suggest an c coding for the below objective ... please help me out of this problem ..i will forward all the relevant data about the project.. Image processing
Attached is the image on which the processing is to be performed
Take this image. It is in .png format.
It has 52 characters written in it.(26 samll a b c d ………z) and 26 capital letters (A B C ………Z)
From this big image we have to segment the image into 52 small images each representing a single character.
Now we have 52 small images. Each of them represents a character.
After this on every image gabor filter is to be applied. Gabor filter is an orientation selective filter. It has some parameters by changing them we can have a set of gabor filters with different parameters.
On each character image 16 gabor filters are to be applied. This way we will have 16 output images for each image.
For all the sixteen images centroid of each image is to be found out. This will have x, y coordinates . find the normalized area of each image. Now every character has 48 components to define it (16 filter images giving 2 coordinates each and area of each output image give 16x2 +16). This can be represented in vector form.
We now have 52 vectors one vector for each image.
To test : given any 48 dimensional vector find the distance of this vector with all 52 vectors. The vector for which difference between given vector and our set of 542 vectors is least wiil be the answer. This means the given vector represents the character “ a” if suppose the difference between given vector and vector for character “a” is found to be the least.
|
|
|
|
|
Will this[^] helpful ?
Regards,
Paresh.
|
|
|
|
|
hi,
I have a msflexgrid with 2 columns and 25 rows(all with data in it) in my dialog.i'm also having a edit box in the same dialog above the flex grid.now wat i want is..if i type a name or a letter in the edit box the mouse pointer should go to that row that contains the name.
for example if i hav 2 colums(name and rollno)in msflexgrid
if i type "A" in the edit box,thn the mouse cursor should go to the row where that name column contains first letter as "A".Is there any function for getting the mouse pointer to our flexgrid?
Anybody please help mi in this regard.
thanks,
panthal
|
|
|
|
|
|
hi,
thanks chandu,
but it's not useful to me. i'am using a flexgrid and a edit box in a dialog . i have 10 row data in the flex grid.
example: first row first cell(0,0) containing data "raja"
second row first cell(1,0) containing data "panthal"
if i enter "panthal" in the edit box, the flexgrid cursor should be highlighted in the second.
is it any function to implement it?
please help me ,
|
|
|
|
|
if it is MS flex grid, then, you can set your required cell using
SetRow(row);
and
SetCol(col);
i hope you would have to explain your task step by step such that, we can understand where exactly you are stuck up.
|
|
|
|
|
thank u very much chandu,
your code is useful to me.
but how can i get my mouse selection to that row? (not the cursor )
and the selected row should be highlighted with a color
i'm waiting for your kind reply,
|
|
|
|
|
Up to which MFC version is this MFCFlexGrid available?
I had to deal with the CListCtrl to make some tables and it was quite annoying at the beggining.I saw the FlexGrid in VB by a partner and was pretty easy to use but I didn't find anything in my doc (VC++ 6)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
i frequently use msflex grid in vc 6.0.
but you have to include it from components and controls into your project.
good luck.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Ahhhmmm, so it is an extra module. I was looking for it in the VStudio 6 package ehehehe, thanks
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hello,
How do we know if we press enter key in CEdit? is there a message? like onclick,onenterkey or something,
i searched alot about it, but i didnt find exactly what i should to do
thanks.
|
|
|
|
|
overide the pretranslate message and check the message.
BOOL MyDlg::PreTranslateMessage(MSG* pMsg) <br />
{<br />
if( pMsg->hwnd == m_edit.m_hWnd && pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN )<br />
{<br />
}<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}
Where m_edit is the control variable of edit control.
|
|
|
|
|
thanks a lot it also useful for me.
|
|
|
|
|
hey..
i am using C++ (wxWindows for GUI)--I have an image file in RAW format ...i have read the file into a 2-D array, how that data is to be used display the image on a control?
thanks
|
|
|
|
|
Dear Colleagues ,
Is there any idea to create a small white hint box to alert the user that he enterd a wrong entry .
Best regards,
|
|
|
|
|
What about using a tooltip?
- NS -
|
|
|
|
|
Do you want allow to user that has a select or you want only to show an alert?
|
|
|
|
|
|
Jarrah_12 wrote: only an alert . thanx
look at CToolTip class, as pointed out by NS!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|