|
I want to be able to control printing to some print queues by
manipulating the spooler files directly. There are two files in a print
job: The .SPL file (which is the actual print job) and the .SHD file
(Shadow file). The .SHD file is the header file with all information about
the print job (User/Name/size/etc...).
Does anyone know what the file format for the .SHD file is? Or can
anyone point me to a location to look for the file structure definition?
Grtx,
Berry
|
|
|
|
|
Hello. I am a VC++ novice. Now I need to save a screen capture bitmap into a JPEG file. How can I do it? If you can post the source code, it will be very grateful. Thanx
Kidd
|
|
|
|
|
GDI+ does it with ease, CodeGuru has classes to do it, and paintlib ( www.paintlib.de ) also does it for a variety of formats.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Oh, Thank you so much. I surfed the website and found paintlib can realize the transformation. If I want the pure source code but not the DLL and library, where should I refer to? Thanx.
|
|
|
|
|
Paintlib comes with all the source code and also compiles linked in so you don't need to carry a dll. The actual source comes from the jpeg group and is a different library in the pintlib project. This is the same jpeg source everyone uses, AFAIK. The link is in the paintlib links page to just get that code.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hello, Christian
It is said the lib can transform the 8-bit and 24-bit bitmap file to jpeg file. But it seems only 8-bit is supported. So many features lost. Thank you. And can I save a bitmap in the memory but not a file to jpeg file? Thanx.
|
|
|
|
|
This is not so - I save 24 bit JPEG's all the time using my program, which uses Paintlib.
Yes, use the JPegEncoder class to save an image from memory, but it needs first to be a CBmp derived format, like CDIBSection ( which can be created from a HBITMAP )
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Yes, You are right. I can save it to 24 bit now. But if I want to save it to ture color, how could I? You really gave me great helps. Thanx
|
|
|
|
|
24 bit IS True Colour. 32 bit includes 8 bits of alpha, which BTW Paintlib appears to support but does nothing with, but in any case add nothing to the colour depth.
I'm glad I've helped.
Alex
|
|
|
|
|
Oh, I see. But a still a problem. I can not save this 32 bit bmp file in to Jpeg file. It said the program only support 8 bits and 24 bits bmp files. Thanx
|
|
|
|
|
Yes, You are right. I can save it to 24 bit now. But if I want to save a ture color bitmap to JPEG, how could I? You really gave me great helps. Thanx
|
|
|
|
|
Yes, You are right. I can save it to 24 bit now. But if I want to save a ture color bitmap to JPEG, how could I? You really gave me great helps. Thanx
|
|
|
|
|
The source code is in the full paintlib distribution ( actually, it's in the extra code you need to download, linked from the paintlib site ). The .lib and .dll are not distributed, you actually build them from the source you download from paintlib.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
If use the following codes, after write DIB to BMP file, it is 32 bit file. But I need 24 bit BMP file.
CBitmap bitmap;
CClientDC dc(pWnd);
CDC memDC;
CRect rect;
memDC.CreateCompatibleDC(&dc);
pWnd->GetClientRect(rect);
bitmap.CreateCompatibleBitmap(&dc, rect.Width() , rect.Height() );
CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
memDC.BitBlt(0, 0, rect.Width(), rect.Height(), &dc, 0, 0, SRCCOPY);
So I changed the codes to these to save to the 24 bit file. But I got nothing.
CBitmap bitmap;
CClientDC dc(pWnd);
CDC memDC;
CRect rect;
memDC.CreateCompatibleDC(&dc);
pWnd->GetClientRect(rect);
bitmap.CreateBitmap( rect.Width(), rect.Height(), 1, 24, NULL );
CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
memDC.BitBlt(0, 0, rect.Width(), rect.Height(), &dc, 2, 27, SRCCOPY);
|
|
|
|
|
You can't select a bitmap of different depth to your DC. To select an image of the depth you want into any DC, use a DIBSection. The above would work if your screen was in 24 bit mode, but the way to make it work always is to create a CDIBSection ( a paintlib class ) and make it 24 bit, then select into your DC.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hello, Christian
I am trying to install the paintlib. But after I extracted the paintlib23a.zip, I did not find the directorys of bin, lib and obj which listed in the directory structure in the document. And did I must download the PaintX and extract it to the paintlib fold? Sorry for so many problems. But I do need your help. Thanx
|
|
|
|
|
You don't need PaintX. If you follow the detailed instructions on the paintlib page, you'll find you need to move and rename some files and then when you do a build you will end up with the bin, lib and obj files. You'll get compilation errors, you can probably ignore them. Also, I change the project to call the debug version paintlibd.lib, otherwise you get trouble with your link paths later on.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Oh, After compliling, I found these directory. But so many errors
|
|
|
|
|
Assuming you renamed the files according to the instructions on the web site, the errors are to do with VC parsing stuff inside #ifdef's, which don't get compiled because they are for other compilers/OS. You should still have the .lib files, which means it compiled OK. Try the diblook sample to see.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Such as E:\Downloaded Application\Extracted\Paintlib\paintlib\otherlib\libjpeg\jinclude.h(60): Could not find the file strings.h.
E:\Downloaded Application\Extracted\Paintlib\paintlib\Otherlib\libjpeg\jmemsys.h(133): Could not find the file Files.h.
Build : warning : failed to (or don't know how to) build 'E:\Downloaded Application\Extracted\Paintlib\paintlib\otherlib\zLib\zutil.c'
Build : warning : failed to (or don't know how to) build 'E:\Downloaded Application\Extracted\Paintlib\paintlib\Otherlib\Libtiff\libtiff\tif_zip.c'
Does that mean I have to download all the other libs such as zLib and Libtiff although I need only libjpeg.
|
|
|
|
|
Ah.... Yes, you need to download them, or there is a spot where you can set some #defines which turn off support for different formats. I can't remember where, but that is probably what you want to find.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hello,
I am running the lib now. But don't know how to use the function
CWinBmp::Bmp.Draw( HDC hDC, int x, int y, DWORD rop = SRCCOPY );
Because I don't know how to get a HDC.
|
|
|
|
|
A CDC or CPaintDC casts to a HDC by itself, a pointer will need to be dereferenced.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hello, Christian
In fact, my project is on the way now and I think I can finish it today. This is the first project I did in VC++. Because of your help, I went in the right way. So please accept my thanks: You really give me great helps Hope I can become an expert like you in the future.
Best Rgds,
Kidd;;)
|
|
|
|
|
Aw, shucks.....
I'm glad I could help - I'm sure you'll pick all this stuff up in no time - the trick is just to keep asking questions and expermenting.
Good luck.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|