PC Review


Reply
Thread Tools Rate Thread

Capture part of the PocketPC-screen?

 
 
Danyel Meyer - dialog-it GmbH
Guest
Posts: n/a
 
      16th Feb 2004
Hallo!

Being quite dissapointed of the transparent-images-issue I´m just working at
a workaround. The aim is to draw a rectangle with a SolidBrush in the needed
background-color somewhere outside the visible screen, and then drawing an
image on it, with Imageattributes.setColorKey set to pixel (1,1).
Now I need to find a possibility how to capture a given region of the screen
(through a ectgle-struure) and put it to some stream in order to reuse it in
a Bitmap constructor...

Any ideas on that?
I have found some examples on screen capturing, but they do not work for me,
as they use a handle to a control that is to be captured, but I just want to
capture some region of the screen...

Many thanks in advance,
--
Danyel Meyer
-------------------------------------------
dialog-it GmbH
Röllinghäuser Strasse 55a
31061 Alfeld/Leine

Tel +49 (0) 5181 900 814
Fax +49 (0) 5181 900 815
E-Mail danyel.meyer <at> dialog-it.de


 
Reply With Quote
 
 
 
 
Danyel Meyer - dialog-it GmbH
Guest
Posts: n/a
 
      16th Feb 2004
Well, okay... no need to capture from the screen.
I have found a method that might be of interest for some of you, so I´ll
share ma idea:

----8<----
Public Function FakeTransparent(ByRef bmp As Bitmap, ByVal bgcolor _
As Color) As Bitmap

Dim tmpBMP As New Bitmap(bmp.Width, bmp.Height)
Dim attr As New System.Drawing.Imaging.ImageAttributes
Dim g As System.Drawing.Graphics = Graphics.FromImage(tmpBMP)

Dim fillRct As New Rectangle(0, 0, bmp.Width, bmp.Height)
Dim brsh As SolidBrush = New SolidBrush(bgcolor)
g.FillRectangle(brsh, fillRct)

Dim c As Color = bmp.GetPixel(1, 1)
attr.SetColorKey(c, c)

Dim dstRect As New Rectangle(0, 0, bmp.Width, bmp.Height)
g.DrawImage(bmp, dstRect, 0, 0, bmp.Width, bmp.Height, _
GraphicsUnit.Pixel, attr)

Return tmpBMP
End Function
---->8----

Hope that´ll be helpfull for someone. It works quite well until now and
gives a simple possibility to change backcolor of an image at runtime and
then use it e.g. in a PictureBox.

Any suggestions to make the function more usefull are greatly appreciated


--
Danyel Meyer
-------------------------------------------
dialog-it GmbH
Röllinghäuser Strasse 55a
31061 Alfeld/Leine

Tel +49 (0) 5181 900 814
Fax +49 (0) 5181 900 815
E-Mail danyel.meyer <at> dialog-it.de

"Danyel Meyer - dialog-it GmbH dialog-it.de>" <info<at> schrieb im
Newsbeitrag news:%(E-Mail Removed)...
> Hallo!
>
> Being quite dissapointed of the transparent-images-issue I´m just working

at
> a workaround. The aim is to draw a rectangle with a SolidBrush in the

needed
> background-color somewhere outside the visible screen, and then drawing an
> image on it, with Imageattributes.setColorKey set to pixel (1,1).
> Now I need to find a possibility how to capture a given region of the

screen
> (through a ectgle-struure) and put it to some stream in order to reuse it

in
> a Bitmap constructor...
>
> Any ideas on that?
> I have found some examples on screen capturing, but they do not work for

me,
> as they use a handle to a control that is to be captured, but I just want

to
> capture some region of the screen...
>
> Many thanks in advance,
> --
> Danyel Meyer
> -------------------------------------------
> dialog-it GmbH
> Röllinghäuser Strasse 55a
> 31061 Alfeld/Leine
>
> Tel +49 (0) 5181 900 814
> Fax +49 (0) 5181 900 815
> E-Mail danyel.meyer <at> dialog-it.de
>
>



 
Reply With Quote
 
=?Utf-8?B?dW1rYw==?=
Guest
Posts: n/a
 
      1st May 2004
I was looking for some posts on capturing screens when I came across ur post. Where do I get sample codes for obtaining screen shots

----- Danyel Meyer - dialog-it GmbH dialog-it. wrote: ----

Hallo

Being quite dissapointed of the transparent-images-issue I´m just working a
a workaround. The aim is to draw a rectangle with a SolidBrush in the neede
background-color somewhere outside the visible screen, and then drawing a
image on it, with Imageattributes.setColorKey set to pixel (1,1)
Now I need to find a possibility how to capture a given region of the scree
(through a ectgle-struure) and put it to some stream in order to reuse it i
a Bitmap constructor..

Any ideas on that
I have found some examples on screen capturing, but they do not work for me
as they use a handle to a control that is to be captured, but I just want t
capture some region of the screen..

Many thanks in advance
--
Danyel Meye
-------------------------------------------
dialog-it Gmb
Röllinghäuser Strasse 55
31061 Alfeld/Lein

Tel +49 (0) 5181 900 81
Fax +49 (0) 5181 900 81
E-Mail danyel.meyer <at> dialog-it.d



 
Reply With Quote
 
Geoff Schwab [MSFT]
Guest
Posts: n/a
 
      2nd May 2004
One method is to use GAPI. It gives you access to the screen memory so you
can do what you want with it. Here is an example:

Dancing Rectangles: Using GAPI to Create a Managed Graphics Library
http://msdn.microsoft.com/library/en.../WrapGAPI1.asp

Geoff
"umkc" <(E-Mail Removed)> wrote in message
news:A71CCEC2-B24B-4C8D-8B24-(E-Mail Removed)...
> I was looking for some posts on capturing screens when I came across ur

post. Where do I get sample codes for obtaining screen shots?
>
> ----- Danyel Meyer - dialog-it GmbH dialog-it. wrote: -----
>
> Hallo!
>
> Being quite dissapointed of the transparent-images-issue I´m just

working at
> a workaround. The aim is to draw a rectangle with a SolidBrush in the

needed
> background-color somewhere outside the visible screen, and then

drawing an
> image on it, with Imageattributes.setColorKey set to pixel (1,1).
> Now I need to find a possibility how to capture a given region of the

screen
> (through a ectgle-struure) and put it to some stream in order to

reuse it in
> a Bitmap constructor...
>
> Any ideas on that?
> I have found some examples on screen capturing, but they do not work

for me,
> as they use a handle to a control that is to be captured, but I just

want to
> capture some region of the screen...
>
> Many thanks in advance,
> --
> Danyel Meyer
> -------------------------------------------
> dialog-it GmbH
> Röllinghäuser Strasse 55a
> 31061 Alfeld/Leine
>
> Tel +49 (0) 5181 900 814
> Fax +49 (0) 5181 900 815
> E-Mail danyel.meyer <at> dialog-it.de
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel screen capture to capture cells and row and column headings jayray Microsoft Excel Misc 5 2nd Nov 2007 11:01 PM
Capture a part of a screen benitAAvi Microsoft Excel Programming 6 17th May 2005 08:46 PM
Looking for a capture device that can capture EVERYTHING on my computer screen. Jeff Ingram Windows XP Video 2 11th Mar 2005 03:34 AM
Looking for a capture device that can capture computer screen. Jeff Ingram ATI Video Cards 5 7th Mar 2005 05:50 AM
PS3 & PocketPC WMP10 in full screen? =?Utf-8?B?ZGhwc3M=?= Windows XP Photos 0 15th Dec 2004 01:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:59 PM.