|
Nelek, would you give some links to learn print?
I want to print contents of my CListCtrl.
Thx first.
|
|
|
|
|
|
Hi,
to print bitmap, I usually use the StrechtBlt ().
to print CListCtrl... I am not really sure if there is something that automates / makes it easy to be printed. I printed the CListCtrl table by hand. Making the lines and writing the contents using "for" and other things.
I recommend you to read the articles about printing by Roger Allan, to begin introducing yourself in printing are quite usefull, but there are aspects that are not commented in them.
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
You can use of BitBlt with a handle to dc of printer.
|
|
|
|
|
Personally I prefer to use StrechtBlt in printing jobs. Main reason is that usually the size of the view is not the same as the printing area, so zooms may be needed.
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
I have loaded image in picture box
It's displaying in center. It gets reduced in size in picture box.
So I need to calculate the reduced size in picture box as image is displayed in center of picture box.
how can I calculate that?
Chetan Joshi
|
|
|
|
|
CJ942002 wrote: how can I calculate that?
You could use GetClientRect() on the picture box.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Do you need to size of picture?
|
|
|
|
|
I have added picture box control having ID IDC_PICTUREBOX
I gave loaded jpg image in that
and I want to stretch that image to width and height
how could I do that?
Chetan Joshi
|
|
|
|
|
CJ942002 wrote: I want to stretch that image to width and height
What width and height?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Did you use of StretchBlt ?
|
|
|
|
|
I am not able to find the NM_CUSTOMDRAW message in messages. How to add this message handler to the project?
|
|
|
|
|
You won't get WM_CUSTOMDRAW message for all the controls.. and also to customize the control you have to derive your own control class from the control base class
Do your Duty and Don't expect the Result
|
|
|
|
|
Thanks for your reply. I am using WM_CTLCOLOR to change the checkbox caption text color. That is working fine when themes service is stopped. When it is enabled it is not working. Some one suggested in this site to use NM_CUSTOMDRAW for that. That's why i am trying. If this doesn't can you suggest me an alternate way to change the checkbox caption text color when windows themes is on?
Thanks in advance.
Regards
|
|
|
|
|
This is a fix in SP1: install the SP1 for VS2005. You need also the redist files for the setups.
Greetings from Germany
|
|
|
|
|
I checked it today. SP1 is already installed. But i am not able to change the text color when themes service is enabled.
Any help?
|
|
|
|
|
Hi All,
i have a problem with the MFC function of the class CDC:
BOOL BitBlt( int x, int y, int nWidth, int nHeight, CDC* pSrcDC, int xSrc, int ySrc, DWORD dwRop )
When i use it for copy a bitmap with an area (in logic coordinates) minor than 8840000 (es. nWidth=5200 e nHeight=1700) it works properly, but with a major value it seems doesn't copy anything and the copy of the original bitmap is completely black. This bitmap resulting by the copy is already set to black previously when i use the function CBitmap::CreateCompatibleBitmap ... so i say that the BitBlt doesn't have any effect in this case.... Did you know why it happens?? Did you know some others MFC functions for doing the copy of bitmaps??
I hope i was enought clear to explain the problem.
I'm sorry if it was already post but i didn't found it.
Thanks in advantage for any help
Bye
TM
|
|
|
|
|
Have you taken a look into StrechBlt (...) ??
Maybe your problem is because the sizes are not matching and the BitBlt doesn't know how to do it with that parameters.
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Tommaso Maggioli wrote: BOOL BitBlt( int x, int y, int nWidth, int nHeight, CDC* pSrcDC,
How your are selecting the bitmap in pSrcDC and in which DC you are coping?..
It will be clear if you post your code little bit...
Do your Duty and Don't expect the Result
|
|
|
|
|
I use the function BitBlt in this way:
<br />
...<br />
...<br />
<br />
pPGMBitmap->copyTo (CpyBitmapDisplay.GetDC(), 0, 0, BMPSize.cx, BMPSize.cy, 0, 0);<br />
...<br />
...<br />
...<br />
...<br />
<br />
void CBitmapDisplay::copyTo(CDC *pdc, int xDest, int yDest, int w, int h, int xSrc, int ySrc)<br />
{<br />
if(pdc && hDC_.GetSafeHdc() != 0)<br />
pdc->BitBlt(xDest, yDest, w,h, &hDC_, xSrc, ySrc, SRCCOPY);<br />
}<br />
...<br />
...<br />
where &hDC is a CDC object of the class CBitmapDisplay....
Thanks
TM
|
|
|
|
|
Is BitBlt returning FALSE? If so, what does GetLastError() return?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm sorry but i see only now that the bitblt operate perfectly and the problem is another....
Thanks to All,
TM
|
|
|
|
|
Don't need to apologise, many times errors are not where we think It is good if you have solved it
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Hi All,
I have created MFC Activex Control using VS 2005.And I have created .cab file(cabinet file )including .inf file into it using cabarc.exe.
And now I want to run it and register it through IE,so I created on .html page including code as below...
<br />
<HTML><br />
<HEAD><br />
<TITLE> Activex Registration </TITLE><br />
</HEAD><br />
<BODY><br />
<OBJECT ID="activex" CLASSID="CLSID:4D607033-7231-4691-9A1D-F59153330B72"<br />
CODEBASE="C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\Bin\Temp_Activex.cab"<br />
</OBJECT><br />
</BODY><br />
<HTML><br />
here CASSID is the CLSID of my Activex Conrol and CODEBASE is the path of the .cab file.
And this page runs very successfully on my local PC and my Activex also runs in the Web Page.
But my problem is when I want to access this page from My Server. I Put Both .cab file and .html file on to the server and then I run this .html file then it shows Security Message of restricting the webpage from running Activex Control(top on the page).When I click on that Strip Message and Select option of Run Activex Control then one Messagebox comes with the details..
<br />
Do you want to run this Activex Control?<br />
<br />
Name:name of My Activex<br />
Publisher : My Publisher Name (Unverified Publisher)<br />
<br />
When I click run then nothing happens ,Mu Activex Control does not run or register.
I have also tried this .cab file by signing with digital signature(using signtool.exe) , But the same problem comes.
So the Moral of the story is that this error of Unverified Publisher.
So Do you have Any Idea or Suggetion?
your Answer Will be Appreciated.
Thanks in Advance.
Ashish Bhatt
|
|
|
|
|
This is getting outside of my area of expertise, as I've never dabbled in activeX, but you'll need to digitally sign your activex with a verifiable certificating.
One supplier I know of is verisign - and I know there are others.
For testing, you may be able to tell IExplorer "always trust this one, really" - but that won;t help your end users.
Yes, this is a cose more felt by small developers - but the reason for it is fairly strong.
I hope that's given you enough hand wavy information for a few good searches if nothing else.
Iain.
|
|
|
|