RE: How would you do it

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Naren (Naren_at_discussions.microsoft.com)
Date: 12/23/04


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.
>
>
>
>
>



Relevant Pages

  • Re: save bitmap to jpg quality loss
    ... Grtz Peter ... >> Hi group I've got a bitmap with a white background in a picturebox and I ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Matching a bitmap color to background color
    ... > I'm having trouble trying to figure this out from the doc. ... If I had that I could then manually alter my ... > bitmap with a resource editor and be on my way. ... You'll need to change the white background to gray, and ...
    (microsoft.public.vc.mfc)
  • Re: LoadMappedBitmap not working?
    ... > This loads and sets the bitmap just fine, ... The white background is still white, ... example) if your resource has more thatn 256 colors. ... CreateMappedBitmapand LoadMappedBitmap() are Unsuccessful With ...
    (microsoft.public.vc.mfc)
  • Re: save bitmap to jpg quality loss
    ... > Hi group I've got a bitmap with a white background in a picturebox and I ... That's due to JPEG compression. ...
    (microsoft.public.dotnet.languages.vb)
  • How would you do it
    ... 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, ...
    (microsoft.public.vc.mfc)