|
Is there any way to apply a rotation matrix to a CDC blt? I am trying to draw a rotated bitmap..
|
|
|
|
|
in NT we have PlgBlt which is not available on 98/ME
there are a few articles on CP that rotate an image
here[^]
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
there you go.
the comments are in german, if you have questions feel free to ask.
void CWool5View::drehe_bild()
{
int x,y;
int xx,yy;
int mipux,mipuy;
double a,r,h;
double pih=3.14159;
BeginWaitCursor();
CClientDC dc(this);
int miny,maxy;
if(rot_l_y<rot_r_y)
{
="" miny="rot_l_y;
" maxy="rot_r_y;
" }
=""
else
="" }
dc.bitblt(="" rot_l_x-20,
="" miny-20,=""
="" rot_r_x-20,="" maxy-20,="" m_pdcmemory,
="" rot_l_x-20-start_videox,="" miny-20-start_videoy,="" srccopy);
="" drehwinkel="" berechnen
double="" rotation;
if(rot_l_y="=rot_r_y)
" rotation="0.0;
else
" ((double)rot_r_x-(double)rot_l_x)="" ((double)rot_r_y-(double)rot_l_y)="" );
="" if(rot_l_y<rot_r_y)
="" }
="" else
="" rotation*="-1.0;
" }
mipux="(int)(float)BMP_width/2.0;
mipuy=(int)(float)BMP_height/2.0;
for" (x="0;" x="" <="" bmp_width;="" ++x)
{
for="" (y="0;" y="" bmp_height;="" ++y)
="" den="" winkel="" aus="" aktuellen="" x,y="" koordinaten="" errechnen.
="" if(x-mipux!="0)
" h="((double)y-mipuy)/((double)x-mipux);
" a="atan(h);
" quadrant="" links="" oben
="" if(="" (x-mipux<0)="" &&="" (y-mipuy<="0))
" a+="pih;
" r="sqrt(((x-mipux)*(x-mipux))" +="" ((y-mipuy)*(y-mipuy))="" );
="" xx="(r*cos(a));
" yy="(r*sin(a));
" if((mipux-xx<0)="" ||="" (mipux-xx="">videogroessex) || (mipuy-yy<0) || (mipuy-yy>videogroessey))
dc.SetPixel(start_videox+x, start_videoy+y, RGB(0,0,0));
else
dc.SetPixel(start_videox+x, start_videoy+y, m_pdcMemory->GetPixel(mipux-xx, mipuy-yy));
}
//quadrant rechts unten
else if( (x-mipux>=0) && (y-mipuy>0))
{
//a+=pih;
r=sqrt(((x-mipux)*(x-mipux)) + ((y-mipuy)*(y-mipuy)) );
a+=rotation;
xx=(r*cos(a));
yy=(r*sin(a));
if((mipux+xx<0) || (mipux+xx>videogroessex) || (mipuy+yy<0) || (mipuy+yy>videogroessey))
dc.SetPixel(start_videox+x, start_videoy+y, RGB(0,0,0));
else
dc.SetPixel(start_videox+x, start_videoy+y, m_pdcMemory->GetPixel(mipux+xx, mipuy+yy));
}
//quadrant links unten
else if( (x-mipux<0) && (y-mipuy>0))
{
//a+=pih;
r=sqrt(((x-mipux)*(x-mipux)) + ((y-mipuy)*(y-mipuy)) );
a+=rotation;
xx=(r*cos(a));
yy=(r*sin(a));
if((mipux-xx<0) || (mipux-xx>videogroessex) || (mipuy-yy<0) || (mipuy-yy>videogroessey))
dc.SetPixel(start_videox+x, start_videoy+y, RGB(0,0,0));
else
dc.SetPixel(start_videox+x, start_videoy+y, m_pdcMemory->GetPixel(mipux-xx, mipuy-yy));
}
//quadrant rechts oben
else if( (x-mipux>=0) && (y-mipuy<=0))
{
//a+=pih;
r=sqrt(((x-mipux)*(x-mipux)) + ((y-mipuy)*(y-mipuy)) );
a+=rotation;
xx=(r*cos(a));
yy=(r*sin(a));
if((mipux+xx<0) || (mipux+xx>videogroessex) || (mipuy+yy<0) || (mipuy+yy>videogroessey))
dc.SetPixel(start_videox+x, start_videoy+y, RGB(0,0,0));
else
dc.SetPixel(start_videox+x, start_videoy+y, m_pdcMemory->GetPixel(mipux+xx, mipuy+yy));
}
}
}
|
|
|
|
|
Since I have made some modifications in the menu "Project" "Settings", my debugger doesn't give me the evolution of the values of the variables I use.
I have always this type of error for all my variables:
m_bCommunicationMode CXX0017: Error: symbol "m_bCommunicationMode" not found
Is there something to modify ?
Thank's for advance
|
|
|
|
|
The only thing I can think of, which I bet you have tried. Rebuild the whole project.
Larry J. Siddens
|
|
|
|
|
Hi all,
How could I integrate all files(.exe, images and other resources) in
a single file of .exe for the distribution and execution of the program ?
(cause I don't want the users to get the images and other resources
when the program in installed on their PC)
Thanks
|
|
|
|
|
use ctl+r and insert wotever you want.
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
You needn't do anything. All resources are integrated into the exe file by default
Robert-Antonio
Give a man a fish, he owes you one fish. Teach a man to fish, you give up
your monopoly on fisheries.
|
|
|
|
|
Hello friends
I am working with a SDI application in which i am drawing on the view.
Steps followed are:
CreateCompatible DC and Bitmap
draw in memory dc
stretch over the view
CDC which is Meomory dc is the global.
But on one of my testing computer XP without Studio installed,
1.0 It seems some of the things are not drawing, it just displays the blank screen.
2.0 Dialog boxes are not appearing.
WHAT CAN BE THE REASON for this?
I am trying this one with Release Mode build
Any suggestion, idea, help
Leave your mark wherever you go
|
|
|
|
|
ok say if you have a function:
BOOL CreateDialog();
that returns false if it fails.
in your code, you do
BOOL Create()
{
ASSERT(CreateDialog());
...
return TRUE;
}
since ASSERT doesn't do anything in release build (compiler ignores it), CreateDialog() doesn't get called. Maybe that's one reason y some of your system is failing... Hope i helped...
or, check your project settings. might discover something there.
|
|
|
|
|
Thanks for your prompt reply
Well problem here is something else.
in my view i am initialising the objevt of the dialog box, assigning its variables and then calling DoModal()
Next complete setup seems to work fine here in the Windows XP and 98 etc, with Visual Studion Installed. On the system where the XP without Visual Studio problems appears
i.e Dialog box doesnot appears
Things does not get drawn on the View, etc
What can be the difference between systems with & without studio installed.
What actually is required to display the dialog box when we are doing do modal?
Thanks again
Leave your mark wherever you go
|
|
|
|
|
Maybe the MFC dlls?
Check the dependecies of the exe with dependency walker and try copy those dlls with your exe
or try to statically link the exe
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
or maybe your computer is just having her period. wait a week and see.
|
|
|
|
|
Hi , i want to trim(srink) and expand windows from the left side , to give the sliding window effect(as one can find in winodws media player where sliding windows open up from both side on button clicks) , but the problem is it can easily be done from the right side, by changing the width attribute of window gradually ,as width attribute always change width from right side.
but how to do this from left side
so any body have any clue.
Unmanaged in a .NET world
|
|
|
|
|
Use SetWindowPos : move the window to the left and increase his size simultaneously. Use
SWP_NOCOPYBITS, SWP_NOREDRAW flags, this causes, that the client area won't be moved with the left border of the window.
Robert-Antonio
"CRAY is the only computer, which runs an endless loop in just 4 hours"
|
|
|
|
|
Hi,
As you know Win32's SetTimer function can be setted with
interval time by 0x7fffffff msec.
But now I want to use more large interval
over 0x7fffffff to timer operation.
Anybody know such function or C++ class that enable me
to do it ?
Or can anyone tell me how to make such function/class ?
Regards
Takanobu Maekawa
|
|
|
|
|
Takanobu Maekawa wrote:
I want to use more large interval
over 0x7fffffff to timer operation.
trying to clock eternity
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
you can try GetSystemTime() , or this MSDN article
TOXCCT >>> GEII power
|
|
|
|
|
you can set up a counter and count it down, everytime your timerFunction get called.
and when the timer got 0 you can perform the
action, that needs this REALY long interval.
|
|
|
|
|
I'm curious why you are after a timer that "fires" once every 24.8 days.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I am not being able to compile the directx codes downloaded from this site or from the msdn help. the compiler(VC++ 6.0) can not recognize the LPDIRECTDRAWSURFACE7 OR LPDIRECTDRAW7.
what may be the reason?plz provide me the solution.
-babai
|
|
|
|
|
Did you download the directX 7.x SDK?
in case you did you need to add the path under tools->options->directories if its not automatically done for you by the installer
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi !
I'm facing a simple problem but couldn't find any clear answer on the net.
I have a class B which is derived from class A. I want to write a copy constructor for class B. In the copy constructor of class B, I copy each member of class B, and I thought that the default copy constructor of class A would be automatically called, which apparently is not the case.
How do make sure the copy constructor of the base class (and of the whole hierarchy) is called ?
Thanks for your help !
Jerome
|
|
|
|
|
// copycons.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
class Base
{
public:
Base(){cout <<"\nBase called";}
Base(const Base&){cout<<"\nCopy of based called";}
};
class Derived : public Base
{
public:
Derived(){cout<<"\nDerived called";}
Derived(const Derived& D):Base(D ){cout<<"\nDerived copy con called";}
};
int main(int argc, char* argv[])
{
Derived d; // default constructor of base and derived will be called
cout<<"\nnow copying const for bot-----------------------------------";
Derived d1=d;
return 0;
}
--------------------------------------------------------------------------
output
Base called
Derived called
now copying const for bot-----------------------------------
Copy of based called
Derived copy con called
Press any key to continue
|
|
|
|
|
// copyCons.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "iostream.h"
class base
{
int k;
public:
base(int j=0)
{
k=j;
}
base(base &b)
{
k=b.k;
}
void putdata()
{
cout<
|
|
|
|