|
steven
how to create bitmap from entire doument? I only know it from view.
thanks,
Cric
|
|
|
|
|
And, this is where it gets complicated. Are you drawing your own document or using a standard control like CEdit?
Maybe it would help if you told us what exactly you are trying to accomplish.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I have scrollview, it will have grid drawn, I draw few graphic objects
in the view. Respective document will store these objects, thir geometry.
( Wish there could be attachment facility with this post )
I have one ddialog wih a picture control in it.
as I scroll view , a bitmap should be captured from whole document with a rectangle showing the scrollview visible area. this bitmap will be displayed on the picture control. or we can use separate view for this purpose which will be a fitted view and will show a rectangle showing scrollviews rectangle.
So every time view is panned the bitmap will get created and it will be displayed in the picture control.
!---------------------
|............................|
|.... ------- ............|<--- nonvisible area
|............................|
||||||||||||||||||||||
|....-------.............. |
|.................... .......|<---- scroll view visible area
||||||||||||||||||||||
|........................... |
|.......------............ |<--- nonvisible area
|__________________|
lines are graphic objects in the view., dotn consider dots they are emplty spaces.
now my bitmap should represent like ..
-----------------------
|..............................|
|..............................|
|........-------............|
|._____________........|
|.|...-------......|.......|
|.|...................|.......|
|.|____________|.......|
|.......------..............|
|__________________|
INternal ractangle in the bitmap is representing the actual current visible
area of the scrolview. This rectangle will always on the different position,
or smaller or bigger depending on zoom, visible area of scrol view.
If the scrolview is fitted it should match the outer rectacngle .
Hope this makes it clear.
Cric
-- modified at 6:35 Saturday 29th April, 2006
|
|
|
|
|
I think that makes sense. Kind of a "preview" control or "where are you" control.
One way to do it would be to just draw your whole document on a temporary memory DC, draw a rectangle on the tempDC indicating the scrollview's current view area, then StretchBlt the temporary DC's bitmap to the preview windows DC.
- S
50 cups of coffee and you know it's on!CDC
|
|
|
|
|
i have created 3 property pages. in these prop. pages i wanna to exchange the data .eg. datat transfer between a edit control on one property page and edit control on another.
can i get help?
jiteen
|
|
|
|
|
Description of class CXmlFile :
+ Data members :
m_tagRoot // Stores root tag (master tag) of the xml file
+ Construction & destruction
CXmlFile //Contructs a CXmlFile objiects
~CXmlFile //Destructs a CXmlFile objiect
+ Operations
LoadTags //Loads the root tag and its child tags in an xml file into memory and store the root tag in m_tagRoot member.
Open //Opens an xml file. This method is also used to creat a new xml file.
close //Closes an xml file.
GetRootTag //Returns pointer point to the root tag.
+ Status
IsReadMode //Returns bool value which specifies whether the xml file is in read mode.
IsWriteMode //Returns bool value which specifies whether the xml file is in write mode.
Thank ! ^_^
My Email : vietsoft2006@yahoo.com
Perseverance for success !
Myhomepage : http://www.bacninh.tk
Welcome my countryside
-- modified at 23:33 Friday 28th April, 2006
|
|
|
|
|
|
Can you explain clearly to me about my problem?
You provide me with code of class CXmlFile, if you can, please.
I need it a lot.
I'm looking forward to hearing from you soon.
Thanks a lot !
perseverance for success !
|
|
|
|
|
Hi everyone,
Please excuse this basic question.
(1) I have created a Setup and Deployment project and one of the dialog
boxes uses a shockwave flash object
(2) I am using Visual Studio .NET 7.1
Problem : The "Movie" property of the ShockWaveFlash object only accepts an
absolute path like "C:\somefile.swf".
I am unable to assign a relative path like "somefile.swf" which picks up the file from the current folder.
Please help on this
|
|
|
|
|
hey does anyone know how to quickly convert a hex value to its corresponding character representation. For example, 4E would convert to F or 50 would convert to P, etc.. etc.. etc.. thanks in advance
|
|
|
|
|
For the below function FkHex2ByteA the resulting byte can be treated (cast) as a char if you know the hex value will map to an ascii character value.
typedef unsigned char byte;
cchar *VkCharHexL = "0123456789abcdef";
byte FkHex2ByteA( char C1, char C2 )
{
C1 = tolower(C1);
C2 = tolower(C2);
cchar *sp1 = strchr(VkCharHexL, C1),
*sp2 = strchr(VkCharHexL, C2);
if( !sp1 || !sp2 ) return(0);
return( ((sp1-VkCharHexL)<<4) + (sp2-VkCharHexL) );
}
void FkByte2HexA( byte B, char &C1, char &C2 )
{
C1 = VkCharHexL[B >> 4];
C2 = VkCharHexL[B & 0x0F];
}
...cmk
Save the whales - collect the whole set
|
|
|
|
|
so it comes together, I suppose I need to dejoin them first. Why add 4 to it and then together? Its insane that this function even works. I don't like that I have to split the value, is that mandatory? I do like that it works to go from hex to dec, which does make dec to ascii easy to do. I could probably do: sprintf(chr,"%s",dec);, right.. close?
thanks
|
|
|
|
|
borono wrote: Why add 4 to it and then together
You don't add 4, you shift left 4 bits.
borono wrote: I don't like that I have to split the value
I gave the code i did to give you a low-level understanding of what is happening.
As others have pointed out in other threads you can also use strtol or sscanf.
I am assuming the hex is in a string e.g. "F012".
As such just loop through the hex string 2 char at a time.
e.g. something like
void HexToStr( cchar *HEX, char *STR )
{
for( ulong i = 0, j = 0; HEX[i] && HEX[i+1]; i+=2, j++ ) {
STR[j] = (char)FkHex2ByteA(HEX[i], HEX[i+1]);
}
}
... of course you would
- add HEX/STR buffer lengths as function param
- do proper error checking
- do more validation that HEX actually contains hex string
- ...
...cmk
Save the whales - collect the whole set
|
|
|
|
|
luckily no. I have the flow dripping --one at a time. 4E then FF, and on; till the end of time or size of transmission (which ever comes first). I thought, initially, I was to split, lets say 4E, making that value 4 and E, and it appears that is indeed the case. I think the function you gave should be good, so I will try it. i will let you know if it works, thanks for the examples.
-- modified at 23:44 Friday 28th April, 2006
Found here: http://users.powernet.co.uk/eton/kandr2/krx203.html
Slightly Modified Code:
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int hexalpha_to_int(int c)
{
char hexalpha[] = "aAbBcCdDeEfF";
int i;
int answer = 0;
for(i = 0; answer == 0 && hexalpha[i] != '\0'; i++)
{
if(hexalpha[i] == c)
{
answer = 10 + (i / 2);
}
}
return answer;
}
unsigned int htoi(const char s[])
{
unsigned int answer = 0;
int i = 0;
int valid = 1;
int hexit;
if(s[i] == '0')
{
++i;
if(s[i] == 'x' || s[i] == 'X')
{
++i;
}
}
while(valid && s[i] != '\0')
{
answer = answer * 16;
if(s[i] >= '0' && s[i] <= '9')
{
answer = answer + (s[i] - '0');
}
else
{
hexit = hexalpha_to_int(s[i]);
if(hexit == 0)
{
valid = 0;
}
else
{
answer = answer + hexit;
}
}
++i;
}
if(!valid)
{
answer = 0;
}
return answer;
}
int conv(char *hex)
{
char *endp = NULL;
unsigned int result;
unsigned int check;
result = htoi(hex);
check = (unsigned int)strtoul(hex, &endp, 16);
if((*endp != '\0' && result == 0) || result == check)
{
printf("%u\n", result);
}
else
{
MessageBox(NULL,"Invalid hexadecimal value.",0,0);
}
return 0;
}
int main(void)
{
conv("4E");
return 0;
}
solved, thank you
|
|
|
|
|
|
hey guys, thanks for the input. I just changed %u to %c.
|
|
|
|
|
So you're wanting to take a string with a hex number in it, and return the character with that ASCII code?
char ch = (char)strtol("4e", NULL, 16);
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I, m writing something about CButton and CCaptionButton (buttons for the titlebar)and I need some text or same exemples. If you have anything please help me.
Vasko Drenoski
|
|
|
|
|
->First set your goal what to do,
->Try to work on it,
->If you have any problem in it...Then come with same
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
Can you be more specific.
|
|
|
|
|
Hi guys,
There is a small bug in this great class (v3.9) and I'm puzzled on how to fix it.
Its regarding tooltips:
Once a tooltip is enabled on a button it works fine. You hover over the button and, as expected, the tooltip is displayed. But, once the button has been pressed the tooltip dissapears never to be seen again!
Any help would be...well, helpfull
|
|
|
|
|
This seems to be a general Windows-ism - I have seen the same bug in with WTL applications, and even an MS guy who works on the WTL framework cannot track it down.
|
|
|
|
|
Hi together,
I'm still working with VC6 and would like to install the latest Platform SDK for it. At Microsoft I can only find the "Windows Server 2003 SP1 Platform SDK 2" version. However, I somewhere read on the web that the "Platform SDK - February 2003" version is the latest one that works with VC6. But I can't find it on the web. Does anybody know where I can get it or how I can update my PSDK for VC6?
Thank you very much,
Marcus.
|
|
|
|
|
khb wrote: Does anybody know where I can get it or how I can update my PSDK for VC6?
are you having the MSDN suscription?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have to admit that I'm not a professional programmer. Ok, I have a legal version of VC6 that I bought several years ago. I simply used it for a long time. Then, somewhen in 2001 or 2002 I downloaded a PSDK version from the MS website as I needed it to use some new functions. Now I want to update my PSDK to make again use of some new functions that the "Feb 2003" release definitively contains. Any idea how I can accomplish that?
Thank you very much for your help,
Marcus.
|
|
|
|