|
Hamid. wrote: And can we use of this code for other formats like jpg?
Nope. You have to change it:
if ( jpegImage1 == jpegImage2) ...
Details for all image formats on www.cpallini.freeproductz.com.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I decided to made a supplement for your magic site.
|
|
|
|
|
how many times do you need to post this same question?
|
|
|
|
|
Of course you can use of CImage class for read your bitmap files and like your code you can use of two loop(See CImage::GetPixel) I think its easy than your code.
|
|
|
|
|
|
Hi,
I am developing a dialog based application in VC++.
In that application for all the dialogs i need to use ActiveX controls.
If i register the coresponding .ocx files and use my application it is working fine. But my problem is if i unregister the .ocx files that dialog is not opening also. Functionality will not work that is ok. but why dialog is not opening at all?
|
|
|
|
|
After adding a toolbar, when drawing the client, I need to adjust the rect which is returned in
GetClientRect .
Is there any way to make it transparent?
logics
|
|
|
|
|
Hope this helps.
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
I mean that make GetClientRect return the client rect exclude the toolbar rect.
logics
|
|
|
|
|
But your question spoke about making it transparent
...anyway, to get the actual client area (drawing area), you can create it as a child window that covers the entire space except the toolbars etc. and put all your controls inside that child window. Then a call to GetClientRect with child window as a parameter will give you the desired rect (you can take a look at this[^]example). I am not aware of any other more sophisticated way to achieve this.
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
void CPixelView::OnDraw(CDC* pDC)
{
CPixelDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
{
COLORREF color[255][255],color1[255][255];
CBitmap bitmap,bitmap1;
CString file1,file2,strText;
file1.Format("C:\\1.bmp");
file2.Format("C:\\3.bmp");
CDC dcMemory,dcMemory1;
int r[255][255],R[255][255];
HBITMAP hBitmap1 = (HBITMAP)::LoadImage(NULL,file1,IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE );//| LR_CREATEDIBSECTION);
HBITMAP hBitmap2 = (HBITMAP)::LoadImage(NULL,file2,IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE );
// Attach the loaded image to the CBitmap object.
bitmap.Attach(hBitmap1);
bitmap1.Attach(hBitmap2);
dcMemory.CreateCompatibleDC(pDC);
dcMemory.SelectObject(&bitmap);
dcMemory1.CreateCompatibleDC(pDC);
dcMemory1.SelectObject(&bitmap1);
pDC->BitBlt(0,0,200,200,&dcMemory,0,0,SRCCOPY);
pDC->BitBlt(0,0,300,700,&dcMemory1,0,0,SRCCOPY);
//for all the pixels
for(int i=0;i<48;i++)
{
for(int j=0;j<48;j++)
{
HDC hDC = ::GetDC(this->GetSafeHwnd());
color[i][j] = ::GetPixel(hDC,i,j);
::ReleaseDC(this->GetSafeHwnd(), hDC);
r[i][j]=GetRValue(color[i][j]);
HDC hDC1 = ::GetDC(this->GetSafeHwnd());
color1[i][j] = ::GetPixel(hDC1,i,j);
::ReleaseDC(this->GetSafeHwnd(), hDC1);
R[i][j]=GetRValue(color1[i][j]);
}
}//got the pixel values
}
}
i am inserting 2 images in this ondraw command and i want to calculate the pixel of both the pictures to compare it...
can anyone tell why it is not working..complilng is done correctly but when exceute it lead to open and window with error file..
please tell asap ....
thank you..
|
|
|
|
|
kaushal kishore sharma wrote: Can anyone tell what is wromg with this code
Yes, it is badly formatted.
BTW:
(1) Be more specific with question title.
(2) Use the code block button to surround code snippets with <pre> tags.
kaushal kishore sharma wrote: but when exceute it lead to open and window with error file..
(3) Report exactly what the error was.
kaushal kishore sharma wrote: please tell asap ....
(4) urgentz questions go automatically down to the bottom of the reply stack.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Why dont you use GetDIBits()??
BTW Please use Code block tags for posting code.
Regards,
Sandip.
|
|
|
|
|
Hi all,
we have a SDK for our products, which was placed under the 'program files' folder up to now. Since MS changed the access rights under Vista, I get a message box asking me whether to restart Visual Studio with elevated permissions, when I open a project.
Now there are two solutions for this problem:
1. Place the SDK with all sample projects somewhere else (but where?), or
2. Set file and folder access rights (How?)
Any thoughts?
jung-kreidler
|
|
|
|
|
You can change permissions using Windows explorer.
Find the parent folder, right click, chose properties.
Go to the security tab and set the appropriate access
permissions for the apropriate users and/or groups.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, thank you. This is the manual way, but we would like to avoid making thinks for our customers more and more complex. I've found icacls to set permissions during setup. What's MS going to do with their SDK's. Do they place them somewhere else (and where), or do they set permissions?
jung-kreidler
|
|
|
|
|
jung-kreidler wrote: What's MS going to do with their SDK's
The latest SDK by default is installed at
C:\Program Files\Microsoft SDKs\Windows\v6.1
I'm not sure what permissions are set since SDK stuff only has to be read-only.
Setting folder permissions is the job of installers. That's why installers
generally need to run with elevated privileges.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks! That's enough info up to now.
InstallShield (installscript) seems not to be capable of setting permissions, so I wrote my own grant.exe... At the moment I'm struggling with the installscript to call my grant .
Happy coding!
jung-kreidler
|
|
|
|
|
jung-kreidler wrote: InstallShield (installscript) seems not to be capable of setting permissions
I don't know InstallShield, but that should be a common operation.
There must be a way to do it
You may want to post another question asking how to set folder permissions
with InstallShield. I'm pretty sure there's a bunch of people here that know
how to use it well.
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, there is a common solution: icacls, but you need the user name. Using 'Users' works only on english Vista. German Vista needs 'Benutzer'. French? Japanese?... So, there is no easy way to deal with the user names. I've decided to get the SID by a command line tool. ...and added the permissions stuff, too.
It works now... till the next bug
jung-kreidler
|
|
|
|
|
Uuups, there is an easy way: Don't use the friendly user or group name, use the following: S-1-5-32-545, which addresses the user group.
Setting S-blah as user to icacls does the job:
icacls dir /grant:r *S-1-5-32-545:rights /T e.g.:
icalcs *.* /grant:r *S-1-5-32-545:F /T gives full access for all users.
This is what I've found out while getting nuts ...
...need some coffee...
jung-kreidler
|
|
|
|
|
Hello everyone,
Not sure whether any of you met with the same issue. I am using x64 WinDbg, it is fine when debugging on x64 machine for an x64 binary -- the source code window is displayed automatically when a break point is hit.
But with x64 WinDbg, when debugging on a x64 machine for an x86 binary, the source code window is not displayed even when a break point is hit.
My questions are,
1. Is it expected behavior?
2. How to make the source window displayed when debugging x86 binary?
thanks in advance,
George
|
|
|
|
|
do you verify, that you have the proper symbols, the source and image file path set properly in windbg? Also the version of the binaries and the source code are the same...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I think so, could you reproduce the problem I described?
regards,
George
|
|
|
|
|
The source code window refuses to open if you don't have proper symbols set or don't have the correct version of binaries and the source. So this would more likely be the case at your end...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|