|
I did so, but it did'nt help. The other either use others' classes or icons.
The others' classes don't seem to have solved the problem either.
It only looks like they do.
|
|
|
|
|
I can think of several possibilies, none of them will be fast.
If the dialog resource does not specify clip-children:
1) Draw the bitmap your self one pixel at a time, that way you can select and chose what to draw. If you use a DIB, this method can be very fast (see articles on DIBs at CP).
2) Scan the bitmap to determine where the edges are and then: create a clipping region (using thos edges), select it into dc and then just blit the image like normal.
If you want, you may be able to use the QuickFill algorithm (article at CP):
1) If you're not specifing clip-children: get a copy of the backgound image (via BitBlt, where you want to draw at), use the image as an argument to QuickFill inorder to fill the backgound (of the bitmap) and then blit the resulting bitmap.
2) If you're specifing clip-children: you'll have to get the backgound image
from the origanal bitmap (this will require some extra work if the images are not 1 to 1), use the image as an argument to QuickFill inorder to fill the backgound (of the bitmap) and then blit the resulting bitmap.
There are probably other ways to accomplish your goal. But the simpilist, and probably the fastest, is to use a DIB. By using a DIB and reading and writing one pixel at a time, you can also have transparent holes in your bitmap image.
Hmmm! A TransparentBlt that take a bitmap instead of a transparent color, sound like an article to me!
Well I hope that helps!
Good luck!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Did you try to use the debugger (F5 to start debugging and F9 to set/remove breakpoints) ? Because there you don't give us a lot of informations to help you....
|
|
|
|
|
Hi all,
Can u pls tell me how to call StoreProcedure from Oracle in VC++ using ODBC????
|
|
|
|
|
Teach yourself database programming in 21 days.
I guess it will help you. It has all the info regarding database programming in VC++
http://www.priyank.in/
|
|
|
|
|
May we access CMainFrame's members from CxxxView ?
Thanks in advance
|
|
|
|
|
You can use that:
((CMainFrame*)AfxGetMainWnd())-> ....
Hope this helps
|
|
|
|
|
May we access CxxxView's members from CMainFrame ?
Thanks in advance
|
|
|
|
|
Yes, you can use GetActiveView() like that:
CxxxView* pView = (CxxxView*)GetActiveView();
|
|
|
|
|
They appear these errors:
k:\paint\paintview.h(21) : error C2143: syntax error : missing ';' before '*'
k:\paint\paintview.h(21) : error C2501: 'CPaintDoc' : missing storage-class or type specifiers
k:\paint\paintview.h(21) : error C2501: 'GetDocument' : missing storage-class or type specifiers
Thanks in advance
|
|
|
|
|
Yesm you probably need to add #include "paintdoc.h" at the begining of your paintview.cpp file.
|
|
|
|
|
Normally, I do not need to add line 'include "PaintDoc.h"', why do we need to add this line now ?
More:
void CMainFrame::SetFColor(UINT nID)
{
CBitmap bitmap;
bitmap.LoadBitmap(nID);
HBITMAP hBitmapOld = ((CStatic*)m_wndMyDialogBar.GetDlgItem(IDC_FCOLOR))->SetBitmap(bitmap);
bitmap.Detach();
if(hBitmapOld != NULL)
DeleteObject(hBitmapOld);
CPaintView* pView;
pView = (CPaintView*)GetActiveView();
pView->m_clrBorderColor = m_clrFColor;
//SendMessage(WM_PAINT);
}
They appear an error here pView->m_clrBorderColor = m_clrFColor;
Thanks in advance
|
|
|
|
|
hcmuns wrote:
pView->m_clrBorderColor = m_clrFColor;
What is the error ?? Maybe because m_clrBorderColor is a private member of CPaintView ? It is a better principle to make all the member variables private and use Get/Set function to access the data
|
|
|
|
|
They both are public members.
I will try set and get functions.
Thanks in advance
|
|
|
|
|
They appear errors when my program is running.
Thanks in advance
|
|
|
|
|
Could you be more specific ??? It is simply impossible to help you with so few information... What are the errors, when did they happen.....
|
|
|
|
|
Please give me email, I will send the program to you.
Thanks in advance
|
|
|
|
|
hcmuns wrote:
Please give me email, I will send the program to you
Nope because:
1) I don't have visual studio installed here so I will need to dig into your code to find the errors without being able to compile it.
2) I don't have the time to correct the project for you. I can help you a little bit but don't ask me to do the job for you
3) You will never become a good programmer if whenever you have a problem you ask the other to do the job for you.
Some guidelines to help you:
Try to use the debugger which is a really powerfull tool and help you to see variables values and see where the program crashes.
Try to formulate correctly the problem. In general, some problems can simply be solved just by a good description of the problem (it becomes much clearer).
If you still have problems I suggest you to start a new thread in the forum (because it is no more related to the first subject) with a good descritption of the problem and eventually some source code (minimalistic otherwise nobody will read it)
|
|
|
|
|
Thank you for your help
|
|
|
|
|
My email : hcmuns@gmail.com
Thanks in advance
|
|
|
|
|
how to crop an image in an application based on dialog? with thanks!
qqworm
|
|
|
|
|
|
(Cropping images)there is an image,which is 696*344,I want to put a box(200*150) on it, then i move the box to the right position with the mouse , at last,i can get a new image which is 200*150. Now I can't complete this , for help,With thanks.
qqworm
|
|
|
|
|
i have two questions:
•say i have a class 'xyz' for example!and i create dynamically the objects!now to create this object,there must be information abt the class in the code!,so where does this code reside?
•is 'delete this' a valid statement?if so,where all is it valid and where all does it become invalid!
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Don't use delete this.
If you write code for the class xyz:
<br />
class xyz<br />
{<br />
xyz(){<br />
_a = 5;<br />
}<br />
<br />
public int someFunction(){<br />
return _a;<br />
}<br />
<br />
private int _a;<br />
};<br />
when you say dynamically create I assume you write "xyz variable = new xyz();"
Then you acess it "int retVal = variable.someFunction();"
Then you delete the dynamically created object "delete variable;"
This is very basic stuff you need to google.
Take a look at some of these[^]
|
|
|
|