如何将Grafics中的数据保存到位图? [英] How to save Data in a Grafics to a Bitmap ?

查看:81
本文介绍了如何将Grafics中的数据保存到位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Grafics对象的全部或部分保存到图像/位图?

我尝试将Images.dll中的图像保存到BitMap文件。

我可以在图像中读到Grafics,但是当我尝试使用Bitmap

时结果是黑色的。

你能以某种方式剪辑Grafic和Paste它是否位于Bitmap?


Mark Johnson,柏林德国
mj **** *@mj10777.de

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

推荐答案

Mark,


看看这个样本:

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

-

Alex Yakhnin,Microsoft嵌入式MVP

IntelliProg,Inc。
http: //www.intelliprog.com

" Mark Johnson" < MJ ***** @ mj10777.de>在消息中写道

新闻:3f *********************** @ newsread2.arcor-online.net ...
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*****@mj10777.de> wrote in message
news:3f***********************@newsread2.arcor-online.net...
如何将Grafics对象的全部或部分保存到图像/位图
?我试图将Images.dll中的图像保存到BitMap文件。
我可以在图像中读到Grafics,但是当我尝试使用Bitmap时
结果是黑色的。
你能以某种方式剪辑Grafic并将其粘贴到位图中吗?

Mark Johnson,柏林德国
mj*****@mj10777.de
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



我认为该示例在保存位图时存在错误24bit

颜色深度。

我相信每一行都需要在4字节边界上启动,或者沿着这些行开始

,它我已经深夜了,我还没有详细研究过,我只看了一下产品并且经历了类似的扭曲效果。


Paul Kay


" Alex Yakhnin,eMVP" <一个******* @ online.att.net>在消息中写道

news:uG ************** @ TK2MSFTNGP12.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.*******@online.att.net> wrote in message
news:uG**************@TK2MSFTNGP12.phx.gbl...
Mark,
看一下这个样本:

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

马克约翰逊 < MJ ***** @ mj10777.de>在消息中写道
新闻:3f *********************** @ newsread2.arcor-online.net ...
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*****@mj10777.de> wrote in message
news:3f***********************@newsread2.arcor-online.net...
如何将Grafics对象的全部或部分保存到
图像/位图
How can you save all or a portion of the Grafics object to a Image/Bitmap
我尝试从卡片中保存图像。 dll到一个BitMap文件。
我可以在图像中读到Grafics,但当我用
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尝试时,结果是黑色的。<你能以某种方式剪辑Grafic并将其粘贴到位图中吗?

Mark Johnson,柏林德国
mj ***** @ mj10777.de




谢谢,我已经完成了所有工作。

- 从cards.dll读取位图

- 保存为位图到文件

- 保存重新读取位图作为Jpeg

- 在WinCe中将位图打包到图形大小

- 在WinCe中保存为位图大小

- 保存重新读取位以WinCe尺寸映射为Jpeg

" Alex Yakhnin,eMVP" <一个******* @ online.att.net> schrieb im Newsbeitrag

新闻:uG ************** @ TK2MSFTNGP12.phx.gbl ...
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.*******@online.att.net> schrieb im Newsbeitrag
news:uG**************@TK2MSFTNGP12.phx.gbl...
Mark,
看一下这个样本:

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

马克约翰逊 < MJ ***** @ mj10777.de>在消息中写道
新闻:3f *********************** @ newsread2.arcor-online.net ...
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*****@mj10777.de> wrote in message
news:3f***********************@newsread2.arcor-online.net...
如何将Grafics对象的全部或部分保存到
图像/位图
How can you save all or a portion of the Grafics object to a Image/Bitmap
我尝试从卡片中保存图像。 dll到一个BitMap文件。
我可以在图像中读到Grafics,但当我用
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尝试时,结果是黑色的。<你能以某种方式剪辑Grafic并将其粘贴到位图中吗?

Mark Johnson,柏林德国
mj ***** @ mj10777.de




这篇关于如何将Grafics中的数据保存到位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆