|
You cannot return a Graphics object.
BTW I dont understand whats the purpose of the above function
what I mean is to do as follows..
CClientDC dc(&m_pictureControl); <br />
Graphics graphics(dc);<br />
CRect rc = GetImageArea(&m_pictureControl);<br />
re.DeflateRect(2,2);<br />
Rect gdiRect(topLeft.x, topLeft.y, rcWidth, rcHeight); graphicObj.SetClip(gdiRect, CombineModeUnion);<br />
do your drawings here.
TheShihan wrote: error C2248: "Gdiplus::Graphics::Graphics": Kein Zugriff auf private Member, dessen Deklaration in der Gdiplus::Graphics-Klasse erfolgte.
( no access to private memember, see declaration in the Graphics-Class)
Sorry I dont know the above language.
|
|
|
|
|
well, I'm stuck... first I show my code:
void xy::DrawPicture()
{
CClientDC dc(&m_pictureControl);
Graphics graphics(dc);
CRect rc = GetImageArea(&m_pictureControl);
CPoint topLeft;
topLeft = rc.TopLeft();
int rcWidth = rc.Width();
int rcHeight = rc.Height();
Rect gdiRect(topLeft.x, topLeft.y, rcWidth, rcHeight);
graphics.SetClip(gdiRect, CombineModeUnion);
m_nPanX = 0;
m_nPanY = 0;
int x = 0,
y = 0;
int size_x = rc.Width();
int size_y = rc.Height();
graphics.DrawImage(m_image, x, y, size_x, size_y);
enableImageManipulation(true);
}
and to make things clearer (hopefully ):
CRect xy::GetImageArea(CWnd * windowElement)
{
CRect rc;
windowElement->GetWindowRect(&rc);
ScreenToClient(&rc);
rc.DeflateRect(2, 2);
return rc;
}
Sooo.. what I don't get or what it's not working is: I don't see any change at all with "CombineModeUnion". I have the "graphics" which is from the "dc", which has the dimensions of the picture control with borders. Then and I have the "rc" (a CRect) which has been deflated 2 pixel on each side.
So in my mind, when I take the UNION of the both "shapes" it should clip the "graphics" object and it should have the dimensions of the smaller "rc", also it should be positioned inside the picture control, spacing 2px on each side and not TOP: 0 LEFT: 0 (as it seems to me it is).
What am I doing wrong, any Ideas?
Thx, Shi
|
|
|
|
|
try using the CombineModeIntersect flag instead of CombineModeUnion
|
|
|
|
|
Can anybody tell me how much area of A4 size paper
we can use for printing???
Is possible to use total area???
ThankXXX...
|
|
|
|
|
Yes it is possible. You can print on the whole area by setting the margin size to 0. Is this regarding a C++ program you made? Otherwise, you may be on the wrong forum.
|
|
|
|
|
I will say it is possible because I have seen doing so programatically. You can expect the maximum area that the printer can use. And one software that I have seen useful for doing so is CorelDRAW.
- NS -
|
|
|
|
|
A4 size paper has size: 210x297 mm.
Yes, You can use total area or whatever area you want for printing.
|
|
|
|
|
Hi
In my programme ,it was an Socket Programme ,datas was sending through socket and Receiving through Socket. Datas are sending as (char*)and receiving as (char*) only.
I want to know wheather i can compress the data before sending and Decompression data after receving with the Vc++ 8.0 code(with out using dll any other third party tools)
I want to done through the code.
So give your suggestion about this.
Regards
shakumar
shakumar
|
|
|
|
|
|
Both
Image and Text Data
shakumar
|
|
|
|
|
|
|
|
shakumar_22 wrote: I want to know wheather i can compress the data before sending and Decompression data after receving
For this, you can use the zLib. It uses the zip/gzip compression format and can be added to your project as a simple DLL offering several routines.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
shakumar_22 wrote: (with out using dll any other third party tools)
I want to done through the code.
So give your suggestion about this.
http://books.google.com/books?id=--MbAAAACAAJ&dq=data+compression+book[^]
seems a harsh requirement... I would recommend using a 3rd party tool, but if you want to understand how compression works, or put it all in code yourself, buy the book.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I am Using Win32 Appplication. Can anybody tell me how to put the Icon on Button.
|
|
|
|
|
|
Hi. Thank u for reply. I tried following code.It dont give me any compile or Run time Error but it isn't showing any Image on the Button. I dont know where m I wrong.
case WM_INITDIALOG:<br />
hIcon = LoadIcon(hInst,(LPCWSTR)IDI_ICON1);<br />
hStart = GetDlgItem(hWndDlg,IDC_Start);<br />
LRESULT lr = SendMessage(hStart,BM_SETIMAGE,(WPARAM)IMAGE_ICON,(LPARAM)hIcon);<br />
if(lr != NULL)<br />
{<br />
OutputDebugString(L"Error");<br />
}<br />
<br />
break;<br />
|
|
|
|
|
Did you set SS_ICON for button?
|
|
|
|
|
Hi. I use the follwing thing in addition to my previos code But still it doesn't work.
<br />
case WM_INITDIALOG:<br />
SetWindowLong( GetDlgItem(hWndDlg, IDC_BUTTON1 ), <br />
GWL_EXSTYLE,<br />
GetWindowLong( GetDlgItem(hWndDlg, IDC_BUTTON1 ), GWL_EXSTYLE ) |SS_ICON );<br />
break;
|
|
|
|
|
Hey. Thnx After a long try its done. n by the way New Style to set for button is BS_ICON.
But I am able to see Only Icon on the Button. Caption just gone. Is there any way So that I can have both on the Button.
|
|
|
|
|
if you can use of owner draw for your button I think its better.
|
|
|
|
|
I am printing one bitmap but the bottom most portion of the bitmap is not getting printed,
wt might be the reason.
i am using default setting of printer.
if somebody know pls let me know abt it.
ThankXXXXX
|
|
|
|
|
The most obvious thing to say is... is the bitmap's ratio of width to height much taller than the printer page? {:v)
It might help if you show us the code that actually 'prints' the bitmap, so we can see if you're doing anything unusual. If you could specify the size of the test bitmap in pixels and the resolution of your printer page in pixels (using the CDC's GetDeviceCaps() method), that would be useful too.
|
|
|
|
|
Can you show how did you try to it?
|
|
|
|