|
I'm not sure what you want to do.
how/where do you paint ? You could "empty" the the view with a FillRect on the entire view area.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
I already found it:
this->Invalidate (true).
But I have another one:
I created a tool bar on my FrameWand but when I scroll it, the tool bar scroll with it how can I make it stay there ????
Thanks
Shay
|
|
|
|
|
I have a little function which reads from a file:
int Read(int iFile, char *szData, size_t iBytes)
{
int iReadThis = 0;
while (iBytes > 0)
{
iReadThis = read(iFile, szData, iBytes);
szData += iReadThis;
iBytes -= iReadThis;
if ( iReadThis == 0 )
return 1;
}
return 0;
}
and I am trying to read through an entire file, say 1 MB at a time or 4 bytes at a time; In either case, I can not read through the whole file because the functions returns 1 at some point and it's not the end of the file either (checked the position of the file pointer). What could be the reason for this and what is a workaround for it?
|
|
|
|
|
1. check for error
georgiek50 wrote:
if ( iReadThis == 0 )
{ //use ::ferror here to check if it is an error
return 1;
}
it is also helpful in debug to put "@err,hr" into watch window, that way you can observe system error.
2. Where did iBytes come from?
3. how did you allocate szData?
|
|
|
|
|
Error return 0, iBytes come from a while loop say 64 at a time or more or less until eof is reached and szData is allocated with new and deleted each time after processing is done. The only way I have found around this is to seek 1 byte ahead every time this occurs but this is does not seem practical enough. Are there any "special" bytes in a file that when read would cause a read to just not respond, or return 0?
|
|
|
|
|
I'm using the Active X Control CImgEdit in one of my apllications to display .pcx files. My problem is that during runtime the control gets more and more memory until the application collapses.
I use :
m_CtrlImageEdit.SetImage ("<filename>.pcx");
m_CtrlImageEdit.Display();
I havent't found a method to "unset" the image assigned to the control.
So every new file assigned to the control and is displayed gets new memory.
So does everyone know a solution to remove the images set by SetImage Method or another way to avoid this memory problem?
|
|
|
|
|
Hello All CPians,
I am working towards getting a start on the VC++.NET side of VS.NET.
I realize this is not an easy language to start with, I was wondering how to get started. Should I just get a book on VC++.NET and go to town? What do you guys recommend??
Thanks In Advance
Tony
|
|
|
|
|
I highly recommend that you master C++ before going into windows programming.
Kuphryn
|
|
|
|
|
kuphryn wrote:
master C++ before going into windows programming
Sounds Good! where do you recommend I start with C++ programming?
Borland C++? or which one.
Thanks
Tony
|
|
|
|
|
I recommend Visual C++ under windows platform and Borland Kylix under Linux. As for fundamental book, I recommend C++ How to Program by Deitel&Deitel.
Kuphryn
|
|
|
|
|
|
I'm trying to get tooltips working on my dialog. I have a toolbar on the dialog which fires tooltip notifications and the tooltips display fine, but tooltips 'inside' frames don't fire the notification and I don't get tooltips.
Anyone know why not?
Dan
|
|
|
|
|
How can I change the background color of a dialog ?
|
|
|
|
|
You can go to the WM_PAINT (OnPaint()) of the dialog and add the following code
CRect rect;
CBrush brush(RGB(100, 0, 0));
dc.GetWindow()->GetWindowRect(&rect);
ScreenToClient(&rect);
dc.FillRect(&rect, &brush);
dc is CPaint dc(this);
Harsha
----------------------------------
http://www.ece.arizona.edu/~hpg
----------------------------------
|
|
|
|
|
One way is to override OnCtlColor(), as follows:
(1) In your message map, add:
<br />
ON_WM_CTLCOLOR()<br />
(2) Then, add the following function to your Dialog class:
(replace CMyDialog with whatever is the proper name in your case)
<br />
HBRUSH CMyDialog::OnCtlColor(CDC *pDC,CWnd *pWnd,UINT nCtlColor)<br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC,pWnd,nCtlColor);<br />
<br />
if(nCtlColor == CTLCOLOR_DLG)<br />
{<br />
hbr = CreateSolidBrush(RGB(0,0,255));<br />
return hbr;<br />
}<br />
<br />
return hbr;<br />
}<br />
You can use this method to change the color of pretty much any
element of your dialog.
|
|
|
|
|
Hi, I am going to write a tiff file viewer, but I don't know the format of the
tiff file. Here I ask my questions,
(1). I googled the format of tiff and didn't find any help information, anyone
can show me an URL to learn the tiff format?
(2) can somebody show me the source code of tiff viewer? How is a tiff file
compressed and displayed?
(3). WHAT I WANT TO DO IS: to display the result of a window moving(1024*768)
on a very large picture(8192*4096). My goal is to MINIMIZE the data to be
transfered over ethernet at each display frame.
Say, I want to have my viewer display 1024*768 pixels at a time, my mouse
move smoothly to change the position of the window. Thus intuitively, at each
time I only need a small ammount of new pixels to be loaded in the viewer,
because the other part should overlap with the former frame. Is ther any
clever method to minimize the data transfer?? (If it were bmp file, I can
expect this is doable.)
---------------------------
| |-------| moving |
| |Window | --> |
| |-------| |
| whole pic |
|-------------------------|
|
|
|
|
|
|
Forgot to mention, there's also libtiff[^], which is free and may be helpful.
- Mike
|
|
|
|
|
Yes. You do not want to implement TIFF from scratch unless you have 6 months extra time on your hands...
John
|
|
|
|
|
Any reason why you are using TIFF? Most developers stay away from TIFF because of the problems with the Unisys patent of LZW.
John
|
|
|
|
|
Because my advisor(in University) want to write a demo software to implement the senario I described above. We have lots of big tiff file(>22MB) on hands.
|
|
|
|
|
I work in a university and understand...
John
|
|
|
|
|
Thanks for the understand. I am a newer in image display
|
|
|
|
|
Also compression is probably not the way you want to go because it is too slow. If it takes 10 seconds to compress your file and 10 seconds to decompress it wouldn't it be faster if you just send the whole file in the first place. You want to send a lower resolution image to the screen. Magnify (by pixel replication) it so that it is the same size and while the user is viewing the image fill in the missing image information.
John
|
|
|
|
|
I agree with you, I think the compressed file is not similiar to the bmp file. I want to know what size it would be to store a same image in bmp(uncompressed image) for a 2048w x 1025h, true color image(which is 2.65MB in tiff format).
By the way, I am a newer in displaying image.
How to calculate the size of bmp for a given size image? could you give me a formula? thanks.
|
|
|
|