|
- Create a 'picture control' to hold the picture
- Derive a class from CStatic that'll draw the picture. It should declare a message map and handle WM_PAINT and use a CImage to hold the image. Note the call to
TransparentBlt , which (as I've coded it) assumes that the top-;peft pixel of hte image is the transparent colour:
class MyPic : public CStatic
{
public:
MyPic();
protected:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
private:
CImage image_;
};
MyPic::MyPic()
{
image_.Load(png filename);
}
void MyPic::OnPaint()
{
PAINTSTRUCT ps;
CDC * drawDC = BeginPaint(&ps);
CRect rcClient;
GetClientRect(&rcClient);
image_.TransparentBlt(*drawDC, rcClient, CRect(0, 0, image_.GetWidth(), image_.GetHeight()), image_.GetPixel(0, 0));
EndPaint(&ps);
} - Declare a member variable wfor the picture control that is of the type you've just made.
- See your picture be displayed!
|
|
|
|
|
Cimage is in VC6.0?
why because i am getting error
|
|
|
|
|
ganesh.dp wrote: Cimage is in VC6.0?
Probably not - but you didn't say you were using 10-11 year old software.
CImage is definitely in VS.NET 2003 - and that's the oldest VS I have.
|
|
|
|
|
|
CImage is just a wrapper around a GDI+ Image [^] - you could try using GDI+ - you will need to get a version of the Platform that a) is compatible with VS6, and b) contains GDI+.
As this Platform SDK[^] is the last one that works with VS6, I guess it's your best option.
|
|
|
|
|
Hi Guys,
I'm looking to be able to position 2 CToolBar objects into an SDI both permanently docked to the top but one left justified and one right justified on the same line. All my efforts so far leave the bars docked one above the other.
Any ideas?
Thanks
|
|
|
|
|
Hi,
I have created one sample application, which has one parent window. There i have created one picture frame, i want to insert one child window in the place of picture frame. I am able to do that and i am able to get vertical scroll bar on dialog box.
In child dialog i calling onpaint() for creating bitmap images and check boxes, there i want to create 20 bit map images, i did that.
Whenever i have scrolled down the scroll bar, the the image which is moving up is erasing, and it is displaiyng like overlapping all the images with one another...
Can any help me to get rid out of this problem..?
Thanks
Venkatesh.
|
|
|
|
|
Hi all,
Please tell me how can i remove this error "Record is too large."
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: Please tell me how can i remove this error "Record is too large."
Drop the table.
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 m not drop the table.
please tell me any solution.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
You should really make a better post in order to get any help. For instance post the relevant code and be more detailed and precise about the error (i.e. aat what line it occurs?).
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]
|
|
|
|
|
Try using smaller records (45s?) or switch to CDs like the rest of us
|
|
|
|
|
BTW: you should use the joke icon...
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 m using table in database, here diffrent type of data types i m using.
when i m add entries in table in form of special characters than this error comes.
i m not using very long data like for Text data type i m using less than 255 characters.
please help me for this.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: please help me for this.
Can you show your database schema? What code are you using to update the database? What is the exact error message?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
hi,
I want to run an internet explorer on my application, which is C++ and on Microsoft Visual Studio (on PocketPc or Windows Mobile Platform).
I use a class CWebBrowser to work with this Control.
I use RegEdit for Mobile and I can't find the GUID of that control on my mobile, therefore the control does not create.
(GUID = 8856F961-340A-11D0-A96B-00C04FD705A2 )
(CLSID = { 0x8856f961, 0x340a, 0x11d0, { 0xa9, 0x6b, 0x0, 0xc0, 0x4f, 0xd7, 0x5, 0xa2 } } )
would someone help me to solve my problem.
Thanks
Miss_F
modified on Thursday, February 5, 2009 5:35 AM
|
|
|
|
|
The REFIID of Pocket Internet Explorer is: L"Microsoft.PIEDocView" .
cheers,
AR
|
|
|
|
|
Thanks for your answer,
I found that CLSID of the "Microsoft.PIEDocView" which was {F5AFC7EF-1571-48B6-A69C-F1833F4C3A44} , I changed the CLSID of CWebBrowser to that, and the Message blew was writen:
...
Load module: browsres.96.dll
Persistence not supported on OLE control {F5AFC7EF-1571-48B6-A69C-F1833F4C3A44}.
>>> Result code: 0x00000000
Load module: WEBVIEW.DLL
...
and the control did not create.
Do you know waht can I do with that?
Regards
Miss_F
|
|
|
|
|
Hi,
Maybe you didn't call ::CoInitializeEx() or otherwise initialize properly.
For diagnostic, compile the ATL sample in <Windows Mobile [5 | 6]\Samples\PocketPC\CPP\ATL\Minipie> and/or the WTL adaptation in <WTL8>\Samples\MiniPie and run the result on your device.
On success, your development environment is OK and there is a problem in your code, otherwise the problem is on your development platform.
cheers,
AR
|
|
|
|
|
Hi,
Thanks a lot for your help,
i run the sample and it works properly, i think i must change my codes.
Regards
Miss_F
|
|
|
|
|
In a header file I have
#define NOMINDEX 0
...
#define ETABLESIZE 5
In the source file that includes this header, the following doesn't seem to work (it's writing 0 to the buffer (and in the watch window in VS, it's saying it doesn't recognise the symbols defined)
sprintf_s( eBuff, 16, "%d", energyTable[ETABLESIZE*sel + NOMINDEX] );
if I add this line before it, "e" is correctly assigned to 5
int e = ETABLESIZE;
sprintf_s( eBuff, 16, "%d", energyTable[ETABLESIZE*sel + NOMINDEX] );
In other parts of my cpp file I use these constants and they seem to work correctly.
Have I done something incredibly stupid?
cheers
Lee
|
|
|
|
|
The answer of course is, yes, I was doing something incredibly stupid. I really ought to try the count to 10 rule before posting
unsurprisingly,
sprintf_s( eBuff, 16, "%.0f", energyTable[ETABLESIZE*sel + NOMINDEX] );
works rather better, since energyTable is a float array
DOH!
sorry.....
|
|
|
|
|
Could it be that your sel variable is 0 and you just didn't notice?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
It should work, indeed. That stated, why don't you use an enum for your symbols?
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]
|
|
|
|