473,581 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to save Data in a Grafics to a Bitmap ?

How can you save all or a portion of the Grafics object to a Image/Bitmap ?
I am try to save the Images from Cards.dll to a BitMap file.
I can read in the Images to the Grafics, but when I try this with a Bitmap
the results are Black.
Can you somehow Clip the Grafic and Paste it into the Bitmap ?

Mark Johnson, Berlin Germany
mj*****@mj10777 .de
Nov 15 '05 #1
9 2633
Mark,

Take a look at this sample:

http://download.microsoft.com/downlo...ampleSetup.exe

--
Alex Yakhnin, Microsoft Embedded MVP
IntelliProg, Inc.
http://www.intelliprog.com

"Mark Johnson" <mj*****@mj1077 7.de> wrote in message
news:3f******** *************** @newsread2.arco r-online.net...
How can you save all or a portion of the Grafics object to a Image/Bitmap ? I am try to save the Images from Cards.dll to a BitMap file.
I can read in the Images to the Grafics, but when I try this with a Bitmap
the results are Black.
Can you somehow Clip the Grafic and Paste it into the Bitmap ?

Mark Johnson, Berlin Germany
mj*****@mj10777 .de

Nov 15 '05 #2
I think there is a bug in that sample when it saves bitmaps with 24bit
colour depth.
I believe each line needs to be started on a 4 byte boundary, or something
along those lines, it's late at night and I haven't studied it in detail, I
just looked at the output and have experienced a similar skewed effect.

Paul Kay

"Alex Yakhnin, eMVP" <a.*******@onli ne.att.net> wrote in message
news:uG******** ******@TK2MSFTN GP12.phx.gbl...
Mark,

Take a look at this sample:

http://download.microsoft.com/downlo...ampleSetup.exe
--
Alex Yakhnin, Microsoft Embedded MVP
IntelliProg, Inc.
http://www.intelliprog.com

"Mark Johnson" <mj*****@mj1077 7.de> wrote in message
news:3f******** *************** @newsread2.arco r-online.net...
How can you save all or a portion of the Grafics object to a Image/Bitmap
?
I am try to save the Images from Cards.dll to a BitMap file.
I can read in the Images to the Grafics, but when I try this with a

Bitmap the results are Black.
Can you somehow Clip the Grafic and Paste it into the Bitmap ?

Mark Johnson, Berlin Germany
mj*****@mj10777 .de


Nov 15 '05 #3
Thank you, I have gotten everything to work.
- Read in the Bitmap from cards.dll
- Save as Bitmap to File
- Save ReRead Bitmap as Jpeg
- Pack Bitmap to Graphics in WinCe Size
- Save as Bitmap in WinCe Size
- Save ReRead Bitmap as Jpeg in in WinCe Size
"Alex Yakhnin, eMVP" <a.*******@onli ne.att.net> schrieb im Newsbeitrag
news:uG******** ******@TK2MSFTN GP12.phx.gbl...
Mark,

Take a look at this sample:

http://download.microsoft.com/downlo...ampleSetup.exe
--
Alex Yakhnin, Microsoft Embedded MVP
IntelliProg, Inc.
http://www.intelliprog.com

"Mark Johnson" <mj*****@mj1077 7.de> wrote in message
news:3f******** *************** @newsread2.arco r-online.net...
How can you save all or a portion of the Grafics object to a Image/Bitmap
?
I am try to save the Images from Cards.dll to a BitMap file.
I can read in the Images to the Grafics, but when I try this with a

Bitmap the results are Black.
Can you somehow Clip the Grafic and Paste it into the Bitmap ?

Mark Johnson, Berlin Germany
mj*****@mj10777 .de


Nov 15 '05 #4
Hi Paul,

Thanks for the input. I will take a look at the sample today and post the
results to this thread.

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/p...Q/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
"Paul Kay" <p.kayATtesco.n etSPAM> wrote in message
news:uf******** ******@TK2MSFTN GP11.phx.gbl...
I think there is a bug in that sample when it saves bitmaps with 24bit
colour depth.
I believe each line needs to be started on a 4 byte boundary, or something
along those lines, it's late at night and I haven't studied it in detail, I just looked at the output and have experienced a similar skewed effect.

Paul Kay

"Alex Yakhnin, eMVP" <a.*******@onli ne.att.net> wrote in message
news:uG******** ******@TK2MSFTN GP12.phx.gbl...
Mark,

Take a look at this sample:

http://download.microsoft.com/downlo...ampleSetup.exe

--
Alex Yakhnin, Microsoft Embedded MVP
IntelliProg, Inc.
http://www.intelliprog.com

"Mark Johnson" <mj*****@mj1077 7.de> wrote in message
news:3f******** *************** @newsread2.arco r-online.net...
How can you save all or a portion of the Grafics object to a Image/Bitmap
?
I am try to save the Images from Cards.dll to a BitMap file.
I can read in the Images to the Grafics, but when I try this with a

Bitmap the results are Black.
Can you somehow Clip the Grafic and Paste it into the Bitmap ?

Mark Johnson, Berlin Germany
mj*****@mj10777 .de



Nov 15 '05 #5
Hi Paul,

I did some testing and cannot seem to reproduce this problem. I tried
images of varying sizes and saved them as 16 and 24 bit bitmaps and they
look fine in the ImageEditor on the device, IE on the device, Paint on the
PC, and Windows Picture Viewer on the PC. I don't think the 32-bit
alignment should be an issue since the bitblt automates that and that would
be the case for 16 bit images as well as 24.

Could you please give me a scenario that causes this problem, including the
size and format of the original image and what changes you made to save it
as 24-bit - I assume just changing the third parameter to
BitampFile.Save ToFile?

Thanks,
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/p...Q/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.

"Geoff Schwab [MSFT]" <a-******@online.m icrosoft.com> wrote in message
news:uU******** ******@TK2MSFTN GP12.phx.gbl...
Hi Paul,

Thanks for the input. I will take a look at the sample today and post the
results to this thread.

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/p...Q/default.aspx
This posting is provided "AS IS" with no warranties, and confers no rights. "Paul Kay" <p.kayATtesco.n etSPAM> wrote in message
news:uf******** ******@TK2MSFTN GP11.phx.gbl...
I think there is a bug in that sample when it saves bitmaps with 24bit
colour depth.
I believe each line needs to be started on a 4 byte boundary, or something
along those lines, it's late at night and I haven't studied it in
detail, I
just looked at the output and have experienced a similar skewed effect.

Paul Kay

"Alex Yakhnin, eMVP" <a.*******@onli ne.att.net> wrote in message
news:uG******** ******@TK2MSFTN GP12.phx.gbl...
Mark,

Take a look at this sample:

http://download.microsoft.com/downlo...ampleSetup.exe

--
Alex Yakhnin, Microsoft Embedded MVP
IntelliProg, Inc.
http://www.intelliprog.com

"Mark Johnson" <mj*****@mj1077 7.de> wrote in message
news:3f******** *************** @newsread2.arco r-online.net...
> How can you save all or a portion of the Grafics object to a

Image/Bitmap
?
> I am try to save the Images from Cards.dll to a BitMap file.
> I can read in the Images to the Grafics, but when I try this with a

Bitmap
> the results are Black.
> Can you somehow Clip the Grafic and Paste it into the Bitmap ?
>
> Mark Johnson, Berlin Germany
> mj*****@mj10777 .de
>
>



Nov 15 '05 #6
Geoff,

I just loaded a known 24bit .bmp image into 'Image Editor' where it
displayed correctly, then I saved it under a new name. Then when viewing
both images using the 'Picture' Application installed on my iPaq 22xx, the
new image is skewed, whereas the original isn't. Strangely, though, on
reloading the skewed copy to 'Image Editor', it displays correctly, as did
the original.

So it would seem the underlying problem is more complex than I originally
surmised. I still haven't looked at the code in any detail or made any
changes to it , but can see that the saved copy is smaller (45.9K 145w*160h)
than the original (68.4K 145w*160h) and therefore I'm guessing that it has
been saved as a 16 bit colour depth. Maybe the sample just isn't intended
to cope with the above scenario in it's raw state, i.e. load a 24 bit
bitmap, save it as 16 bit.

Now, the next bit of testing I've just done is even more interesting, the
Image viewer portion of the application I'm in the process of writing
displays both the original and the saved 16bit version correctly. So.....
I'm beginning to think that in fact it's the 'Picture' application that
comes installed on the new Windows Mobile 2003 Pocket PCs that doesn't
handle 16bit bitmaps correctly and that both the sample and my code do.

Therefore, (I'm testing as I'm writing this) I apologise, it seems the Image
Editor Sample is in fact fine...... but the installed (in Rom) 'Pictures'
Application, pimg.exe doesn't.... Ouch, sorry I wasted your time checking
the sample, but perhaps you'd better talk to the pimg.exe 'team'.

My apologies, it was a bit late last night (actually early this (or now
yesterday) morning) when I looked at the sample, I should have investigated
more before commenting, but I'd coincidently spent much of the day writing
bitmap saving code and had been using the pimg.exe to test the results,
thinking it must be solid.

Regards
Paul
"Geoff Schwab [MSFT]" <a-******@online.m icrosoft.com> wrote in message
news:uD******** ******@tk2msftn gp13.phx.gbl...
Hi Paul,

I did some testing and cannot seem to reproduce this problem. I tried
images of varying sizes and saved them as 16 and 24 bit bitmaps and they
look fine in the ImageEditor on the device, IE on the device, Paint on the
PC, and Windows Picture Viewer on the PC. I don't think the 32-bit
alignment should be an issue since the bitblt automates that and that would be the case for 16 bit images as well as 24.

Could you please give me a scenario that causes this problem, including the size and format of the original image and what changes you made to save it
as 24-bit - I assume just changing the third parameter to
BitampFile.Save ToFile?

Thanks,
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/p...Q/default.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
"Geoff Schwab [MSFT]" <a-******@online.m icrosoft.com> wrote in message
news:uU******** ******@TK2MSFTN GP12.phx.gbl...
Hi Paul,

Thanks for the input. I will take a look at the sample today and post the
results to this thread.

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility

http://msdn.microsoft.com/mobility/p...Q/default.aspx

This posting is provided "AS IS" with no warranties, and confers no

rights.
"Paul Kay" <p.kayATtesco.n etSPAM> wrote in message
news:uf******** ******@TK2MSFTN GP11.phx.gbl...
I think there is a bug in that sample when it saves bitmaps with 24bit
colour depth.
I believe each line needs to be started on a 4 byte boundary, or

something along those lines, it's late at night and I haven't studied it in detail,
I
just looked at the output and have experienced a similar skewed effect.
Paul Kay

"Alex Yakhnin, eMVP" <a.*******@onli ne.att.net> wrote in message
news:uG******** ******@TK2MSFTN GP12.phx.gbl...
> Mark,
>
> Take a look at this sample:
>
>

http://download.microsoft.com/downlo...ampleSetup.exe
>
> --
> Alex Yakhnin, Microsoft Embedded MVP
> IntelliProg, Inc.
> http://www.intelliprog.com
>
> "Mark Johnson" <mj*****@mj1077 7.de> wrote in message
> news:3f******** *************** @newsread2.arco r-online.net...
> > How can you save all or a portion of the Grafics object to a
Image/Bitmap
> ?
> > I am try to save the Images from Cards.dll to a BitMap file.
> > I can read in the Images to the Grafics, but when I try this with a Bitmap
> > the results are Black.
> > Can you somehow Clip the Grafic and Paste it into the Bitmap ?
> >
> > Mark Johnson, Berlin Germany
> > mj*****@mj10777 .de
> >
> >
>
>



Nov 15 '05 #7
Hi Mark,

Just wondering... what did you use to save bitmap as jpeg?
Native jpeglib?

--
Alex Yakhnin, Microsoft Embedded MVP
IntelliProg, Inc.
http://www.intelliprog.com

"Mark Johnson" <mj*****@mj1077 7.de> wrote in message
news:3f******** *************** @newsread2.arco r-online.net...
Thank you, I have gotten everything to work.
- Read in the Bitmap from cards.dll
- Save as Bitmap to File
- Save ReRead Bitmap as Jpeg
- Pack Bitmap to Graphics in WinCe Size
- Save as Bitmap in WinCe Size
- Save ReRead Bitmap as Jpeg in in WinCe Size
"Alex Yakhnin, eMVP" <a.*******@onli ne.att.net> schrieb im Newsbeitrag
news:uG******** ******@TK2MSFTN GP12.phx.gbl...
Mark,

Take a look at this sample:

http://download.microsoft.com/downlo...ampleSetup.exe

--
Alex Yakhnin, Microsoft Embedded MVP
IntelliProg, Inc.
http://www.intelliprog.com

"Mark Johnson" <mj*****@mj1077 7.de> wrote in message
news:3f******** *************** @newsread2.arco r-online.net...
How can you save all or a portion of the Grafics object to a Image/Bitmap
?
I am try to save the Images from Cards.dll to a BitMap file.
I can read in the Images to the Grafics, but when I try this with a

Bitmap the results are Black.
Can you somehow Clip the Grafic and Paste it into the Bitmap ?

Mark Johnson, Berlin Germany
mj*****@mj10777 .de



Nov 15 '05 #8
Hi Paul,

No problem, this is good information to have. There tends to be a bit of
inconsistency with the BMP "standard." From the most reliable resources I
have found, a 16 bit image (as reported by BITMAPINFOHEADE R::biBitCount) is
always supposed to be 565 RGB format, whereas an image reported as 15 (not
16) bit is 555. I actually went against this standard in the sample because
all of the commercial products I tested with only supported a 16 bit 555
formatted image which is technically wrong but seems to have become the de
facto industry standard.

I don't know if this has anything to do with what you are seeing but thank
you for following up!

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/p...Q/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
"Paul Kay" <p.kayATtesco.n etSPAM> wrote in message
news:OZ******** ******@TK2MSFTN GP09.phx.gbl...
Geoff,

I just loaded a known 24bit .bmp image into 'Image Editor' where it
displayed correctly, then I saved it under a new name. Then when viewing
both images using the 'Picture' Application installed on my iPaq 22xx, the
new image is skewed, whereas the original isn't. Strangely, though, on
reloading the skewed copy to 'Image Editor', it displays correctly, as did
the original.

So it would seem the underlying problem is more complex than I originally
surmised. I still haven't looked at the code in any detail or made any
changes to it , but can see that the saved copy is smaller (45.9K 145w*160h) than the original (68.4K 145w*160h) and therefore I'm guessing that it has
been saved as a 16 bit colour depth. Maybe the sample just isn't intended
to cope with the above scenario in it's raw state, i.e. load a 24 bit
bitmap, save it as 16 bit.

Now, the next bit of testing I've just done is even more interesting, the
Image viewer portion of the application I'm in the process of writing
displays both the original and the saved 16bit version correctly. So..... I'm beginning to think that in fact it's the 'Picture' application that
comes installed on the new Windows Mobile 2003 Pocket PCs that doesn't
handle 16bit bitmaps correctly and that both the sample and my code do.

Therefore, (I'm testing as I'm writing this) I apologise, it seems the Image Editor Sample is in fact fine...... but the installed (in Rom) 'Pictures'
Application, pimg.exe doesn't.... Ouch, sorry I wasted your time checking
the sample, but perhaps you'd better talk to the pimg.exe 'team'.

My apologies, it was a bit late last night (actually early this (or now
yesterday) morning) when I looked at the sample, I should have investigated more before commenting, but I'd coincidently spent much of the day writing
bitmap saving code and had been using the pimg.exe to test the results,
thinking it must be solid.

Regards
Paul
"Geoff Schwab [MSFT]" <a-******@online.m icrosoft.com> wrote in message
news:uD******** ******@tk2msftn gp13.phx.gbl...
Hi Paul,

I did some testing and cannot seem to reproduce this problem. I tried
images of varying sizes and saved them as 16 and 24 bit bitmaps and they
look fine in the ImageEditor on the device, IE on the device, Paint on the
PC, and Windows Picture Viewer on the PC. I don't think the 32-bit
alignment should be an issue since the bitblt automates that and that would
be the case for 16 bit images as well as 24.

Could you please give me a scenario that causes this problem, including

the
size and format of the original image and what changes you made to save it as 24-bit - I assume just changing the third parameter to
BitampFile.Save ToFile?

Thanks,
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility

http://msdn.microsoft.com/mobility/p...Q/default.aspx

This posting is provided "AS IS" with no warranties, and confers no

rights.

"Geoff Schwab [MSFT]" <a-******@online.m icrosoft.com> wrote in message
news:uU******** ******@TK2MSFTN GP12.phx.gbl...
Hi Paul,

Thanks for the input. I will take a look at the sample today and post

the results to this thread.

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility

http://msdn.microsoft.com/mobility/p...Q/default.aspx

This posting is provided "AS IS" with no warranties, and confers no

rights.
"Paul Kay" <p.kayATtesco.n etSPAM> wrote in message
news:uf******** ******@TK2MSFTN GP11.phx.gbl...
> I think there is a bug in that sample when it saves bitmaps with 24bit > colour depth.
> I believe each line needs to be started on a 4 byte boundary, or

something
> along those lines, it's late at night and I haven't studied it in

detail,
I
> just looked at the output and have experienced a similar skewed effect. >
> Paul Kay
>
> "Alex Yakhnin, eMVP" <a.*******@onli ne.att.net> wrote in message
> news:uG******** ******@TK2MSFTN GP12.phx.gbl...
> > Mark,
> >
> > Take a look at this sample:
> >
> >
>

http://download.microsoft.com/downlo...ampleSetup.exe
> >
> > --
> > Alex Yakhnin, Microsoft Embedded MVP
> > IntelliProg, Inc.
> > http://www.intelliprog.com
> >
> > "Mark Johnson" <mj*****@mj1077 7.de> wrote in message
> > news:3f******** *************** @newsread2.arco r-online.net...
> > > How can you save all or a portion of the Grafics object to a
> Image/Bitmap
> > ?
> > > I am try to save the Images from Cards.dll to a BitMap file.
> > > I can read in the Images to the Grafics, but when I try this
with a > Bitmap
> > > the results are Black.
> > > Can you somehow Clip the Grafic and Paste it into the Bitmap ?
> > >
> > > Mark Johnson, Berlin Germany
> > > mj*****@mj10777 .de
> > >
> > >
> >
> >
>
>



Nov 15 '05 #9
Geoff,

I guess then 15/16bit is a 'grey' area (pun intended)

Paul

"Geoff Schwab [MSFT]" <a-******@online.m icrosoft.com> wrote in message
news:eC******** ******@TK2MSFTN GP10.phx.gbl...
Hi Paul,

No problem, this is good information to have. There tends to be a bit of
inconsistency with the BMP "standard." From the most reliable resources I
have found, a 16 bit image (as reported by BITMAPINFOHEADE R::biBitCount) is always supposed to be 565 RGB format, whereas an image reported as 15 (not
16) bit is 555. I actually went against this standard in the sample because all of the commercial products I tested with only supported a 16 bit 555
formatted image which is technically wrong but seems to have become the de
facto industry standard.

I don't know if this has anything to do with what you are seeing but thank
you for following up!

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/p...Q/default.aspx
This posting is provided "AS IS" with no warranties, and confers no rights. "Paul Kay" <p.kayATtesco.n etSPAM> wrote in message
news:OZ******** ******@TK2MSFTN GP09.phx.gbl...
Geoff,

I just loaded a known 24bit .bmp image into 'Image Editor' where it
displayed correctly, then I saved it under a new name. Then when viewing
both images using the 'Picture' Application installed on my iPaq 22xx, the
new image is skewed, whereas the original isn't. Strangely, though, on
reloading the skewed copy to 'Image Editor', it displays correctly, as did the original.

So it would seem the underlying problem is more complex than I originally surmised. I still haven't looked at the code in any detail or made any
changes to it , but can see that the saved copy is smaller (45.9K 145w*160h)
than the original (68.4K 145w*160h) and therefore I'm guessing that it has been saved as a 16 bit colour depth. Maybe the sample just isn't intended to cope with the above scenario in it's raw state, i.e. load a 24 bit
bitmap, save it as 16 bit.

Now, the next bit of testing I've just done is even more interesting, the Image viewer portion of the application I'm in the process of writing
displays both the original and the saved 16bit version correctly.

So.....
I'm beginning to think that in fact it's the 'Picture' application that
comes installed on the new Windows Mobile 2003 Pocket PCs that doesn't
handle 16bit bitmaps correctly and that both the sample and my code do.

Therefore, (I'm testing as I'm writing this) I apologise, it seems the

Image
Editor Sample is in fact fine...... but the installed (in Rom) 'Pictures' Application, pimg.exe doesn't.... Ouch, sorry I wasted your time checking the sample, but perhaps you'd better talk to the pimg.exe 'team'.

My apologies, it was a bit late last night (actually early this (or now
yesterday) morning) when I looked at the sample, I should have

investigated
more before commenting, but I'd coincidently spent much of the day writing bitmap saving code and had been using the pimg.exe to test the results,
thinking it must be solid.

Regards
Paul
"Geoff Schwab [MSFT]" <a-******@online.m icrosoft.com> wrote in message
news:uD******** ******@tk2msftn gp13.phx.gbl...
Hi Paul,

I did some testing and cannot seem to reproduce this problem. I tried
images of varying sizes and saved them as 16 and 24 bit bitmaps and they look fine in the ImageEditor on the device, IE on the device, Paint on the PC, and Windows Picture Viewer on the PC. I don't think the 32-bit
alignment should be an issue since the bitblt automates that and that

would
be the case for 16 bit images as well as 24.

Could you please give me a scenario that causes this problem, including the
size and format of the original image and what changes you made to
save it as 24-bit - I assume just changing the third parameter to
BitampFile.Save ToFile?

Thanks,
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility

http://msdn.microsoft.com/mobility/p...Q/default.aspx
This posting is provided "AS IS" with no warranties, and confers no

rights.

"Geoff Schwab [MSFT]" <a-******@online.m icrosoft.com> wrote in message
news:uU******** ******@TK2MSFTN GP12.phx.gbl...
> Hi Paul,
>
> Thanks for the input. I will take a look at the sample today and post
the
> results to this thread.
>
> --
> Geoff Schwab
> Program Manager
> Excell Data Corporation
> http://msdn.com/mobility
>

http://msdn.microsoft.com/mobility/p...Q/default.aspx >
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Paul Kay" <p.kayATtesco.n etSPAM> wrote in message
> news:uf******** ******@TK2MSFTN GP11.phx.gbl...
> > I think there is a bug in that sample when it saves bitmaps with 24bit > > colour depth.
> > I believe each line needs to be started on a 4 byte boundary, or
something
> > along those lines, it's late at night and I haven't studied it in
detail,
> I
> > just looked at the output and have experienced a similar skewed

effect.
> >
> > Paul Kay
> >
> > "Alex Yakhnin, eMVP" <a.*******@onli ne.att.net> wrote in message
> > news:uG******** ******@TK2MSFTN GP12.phx.gbl...
> > > Mark,
> > >
> > > Take a look at this sample:
> > >
> > >
> >
>

http://download.microsoft.com/downlo...ampleSetup.exe
> > >
> > > --
> > > Alex Yakhnin, Microsoft Embedded MVP
> > > IntelliProg, Inc.
> > > http://www.intelliprog.com
> > >
> > > "Mark Johnson" <mj*****@mj1077 7.de> wrote in message
> > > news:3f******** *************** @newsread2.arco r-online.net...
> > > > How can you save all or a portion of the Grafics object to a
> > Image/Bitmap
> > > ?
> > > > I am try to save the Images from Cards.dll to a BitMap file.
> > > > I can read in the Images to the Grafics, but when I try this

with
a
> > Bitmap
> > > > the results are Black.
> > > > Can you somehow Clip the Grafic and Paste it into the Bitmap ?
> > > >
> > > > Mark Johnson, Berlin Germany
> > > > mj*****@mj10777 .de
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
61729
by: charsh | last post by:
Hi, I using the code below to draw a text in a pictureBox1. //Start--------------------------------------------------------------- private void button1_Click(object sender, System.EventArgs e) { Graphics g; g = pictureBox1.CreateGraphics(); g.FillRectangle(Brushes.White,0,0,160,160);
12
57271
by: yaya via DotNetMonster.com | last post by:
Hi, I have a picture box with circles and rectangles, and I wana save all the images into a jpg file, i tried pictureBox1.Image.Save(@"c:\1.jpg"); but I got and error "System.NullReferenceException: Object reference not set to an instance of an object." Can anyone help? Thanks... --
2
1880
by: TC | last post by:
I would like to save bitmaps to a file stream, but I can't get the Bitmap.Save(Stream) overload to work. If I save one bitmap to the stream, it works okay, but if I save two or more, they all become garbled. I saw another post where someone questioned whether there is a bug, but there was no definitive answer. So, how about it? Does...
2
1670
by: Peter Proost | last post by:
Hi group when save a bitmap called saveBmp like this: <<<< saveBmp.Save(filename, ImageFormat.Jpeg) <<<< the bitmap gets saved with it's size propertys, so if I right click the file and select propertys I can see the width and the height of the image. But if I save the bitmap as a bitmap:
9
2142
by: DapDap | last post by:
I have manage to open a image into a picture box. But I have problem in Saving it into database SQL Server. How to save the image ??
1
6487
by: WB | last post by:
Hi, I have a helper class that has a method to resize images. It takes the virtual path of an image and resize it to a specified dimension like this. public void ResizeImageTest(string pathImage, int newDimension) { string pathImageOnDisk = System.Web.HttpContext.Current.Server.MapPath(pathImage); System.IO.FileStream fs = new...
1
3444
by: Stedak | last post by:
I have the following class I use to save Tiff's. The problem I have with it is that the final size of the images are very large. If we scan directly to a file the final tiff may be 600-900 kb.s but with this code it is often 4000-5000 kb.s. What am I missing? public class EmrTiff : IDisposable { private string fileName; private ArrayList...
3
16723
by: SveinErik | last post by:
Hi, I'm trying to find a method to save bmp, jpg and png files as ico files, 16x16 size. I have managed to convert and save bmp files to icon, but only in 32x32 size. I can't figure out how to save it in the size: 16x16, and I hope someone could help me out a bit? Code that saves from bmp to ico (32x32): private void...
13
2284
by: Joe | last post by:
does anyone know why this source code throws an error?? Dim myBitmap As System.Drawing.Bitmap Dim myGraphics As Graphics myBitmap = New System.Drawing.Bitmap(fileName:="C:\test.tif") myGraphics = PictureBox1.CreateGraphics Dim expansionRectangle As New Rectangle(25, 550, 1000, 350) Dim destRectangle1 As New Rectangle(0, 0, 1000, 350)...
0
7804
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7910
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6563
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1144
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.