RE: How would you do it
From: Naren (Naren_at_discussions.microsoft.com)
Date: 12/23/04
- Next message: Okie: "RE: Hooking/editing the caption of a dialog"
- Previous message: srVas: "Re: Create a new type"
- In reply to: Vince: "How would you do it"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 22 Dec 2004 20:25:02 -0800
hi
the actual method is to save the attributes of that in afile. suppose if the
bitmap have the white background and the pictureloaded was sample.bmp. you
have to save the file as follows
//contents of the saved file
BACKGROUND: white
FILENAME: c:\\sample.bmp
when the user loads the file what he have saved, you have to parse through
the file and reload the attributes stored in the file.
the odd method is to take the two dimentional array that is large enough to
hold the bitmap dimensions. and fill that structure with the data that u can
get by GetPixel() function. when the user loads the bitmap reload the data by
using the PutPixel() funtion. the procedure is as follows
// storing bitmap to file
LONG m_bmpData[100][100] ; // in case of 100X100 dimensional
// suppose the bitmap stored at the coordinates of (150,100,250,200)
for(int i=150,int m=0; i<250,m<100; i++,m++)
for(int j=100,int n=0; j<200, n<100;j++, n++)
m_bmpData[m][n] = GetPixel(i,j) ;
// store that in the file bu using the tradtional Write function
// loading the bitmap that was stored proviously
// load the m_bmpData array with the file content by using traditional read
function
//to display the actual content add the following code
for(int i=150,int m=0; i<250,m<100; i++,m++)
for(int j=100,int n=0; j<200, n<100;j++, n++)
SetPixel(i,j, m_bmpData[m][n]) ;
"Vince" wrote:
> Hi,
>
> I would like to create an application where user can create Cstatic control
> dynamically over a background image and enter some text.
> How can I save merge all the controls in a bitmap.
>
> For instance I want to display a Cstatic with a white background, user can
> insert a bitmap and add some text and then save his work.
> Hope it's clear.
>
>
>
>
>
- Next message: Okie: "RE: Hooking/editing the caption of a dialog"
- Previous message: srVas: "Re: Create a new type"
- In reply to: Vince: "How would you do it"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|