ynsryw4y6msm



u crapass
u crap at everyting
suc my nob u crapass

On Tuesday, August 26, 2008 1:15 PM Chris Farmer wrote:

Hi all, I'm trying to remove 2 pictureboxes and do the work with memory
HDC's
This is what is causing my problem, whichever HDC is created first seems to
work fine
but the second HDC is just a black picture.

Sub Setup_HDCs()
Dim MyBM As StdPicture
Set MyBM = PictureFromDC(picShown.hDC, 0, 0, picShown.ScaleWidth,
picShown.ScaleHeight)
HDC_Backup = CreateCompatibleDC(picShown.hDC)
Call SelectObject(HDC_Backup, MyBM.Handle)
HDC_Hidden = CreateCompatibleDC(picShown.hDC)
Call SelectObject(HDC_Hidden, MyBM.Handle)
Set MyBM = Nothing
End Sub


if I bitblt HDC_Backup I get a the correct picture BUT
if I bitblt HDC_hiddem I get a BLACK picture

If I swap the sub above around its always the second HDC that gives the
black picture.
What am I doing wrong?


On Wednesday, August 27, 2008 3:43 AM Dean Earley wrote:

Chris Farmer wrote:

You can only have one DC selected into a bitmap at a time.
Depending on what you are actually trying to do, you may have to just
duplicate the code.

--
Dean Earley (dean.earley@xxxxxxxxxxx)
i-Catcher Development Team

iCode Systems


On Wednesday, August 27, 2008 7:55 AM Thorsten Albers wrote:

Dean Earley <dean.earley@xxxxxxxxxxx> schrieb im Beitrag
<O9sfpiBCJHA.3496@xxxxxxxxxxxxxxxxxxxx>...

Presumably you mean
1. You can only have one bitmap selected into a DC at a time
2. You can only have a bitmap selected into one DC at a time

--
----------------------------------------------------------------------
Thorsten Albers albers(a)uni-freiburg.de
----------------------------------------------------------------------


On Wednesday, August 27, 2008 8:06 AM Dean Earley wrote:

Thorsten Albers wrote:

They're the ones. Sorry for any confusion.

--
Dean Earley (dean.earley@xxxxxxxxxxx)
i-Catcher Development Team

iCode Systems


On Wednesday, August 27, 2008 8:40 AM Chris Farmer wrote:

yes the problem was setting MYBM to the same stdpicture
instead of using two picture references for the same picture.
set MYBM1 = the picture
set MYBM2 = the picture
Then I can select each of these into the two HDC's

Thanks for you help
Chris

"Dean Earley" <dean.earley@xxxxxxxxxxx> wrote in message
news:uWZMW1DCJHA.2292@xxxxxxxxxxxxxxxxxxxxxxx


On Wednesday, August 27, 2008 3:00 PM Thorsten Albers wrote:

Chris Farmer <H313AGF@xxxxxxx> schrieb im Beitrag
<utrZOIECJHA.4340@xxxxxxxxxxxxxxxxxxxx>...

Is there a reason for the use of a picture object? Since the picture object
'contents' is first retrieved from a DC and later selected into another DC
there is no need for using a picture object - unless the picture object
doesn't get manipulated somewhere else with special picture object methods
of VB.

--
----------------------------------------------------------------------
Thorsten Albers albers(a)uni-freiburg.de
----------------------------------------------------------------------


On Thursday, August 28, 2008 6:00 PM Chris Farmer wrote:

Yes the picture object is what the user sees in the Picture Box
I'm just using the 2 memory DCs to manipulate regions of this picture and
bitblt it back to the picturebox based on the users interaction.
Its all working fine now, thanks
Chris

"Thorsten Albers" <albersRE@xxxxxxxxxxxxxxxxxxx> wrote in message
news:01c90877$1d51cb80$af01a8c0@xxxxxxxxx



.



Relevant Pages

  • Re: Clip capture
    ... "when you say you are "getting a negative number on the hDC" do you ... "If the Autoredraw property of the picture box on the second Form is True ... "And does your code set up the picture box to the size of the blit *and* do ... > the bitmap is smaller than the blit, but with the "extra bitmap area" ...
    (comp.lang.basic.visual.misc)
  • Re: Update a graphic and save it
    ... discovered that saving the image as opposed to the picture would keep the ... text I had written, but since the image won't fit on the screen, saving it ... TextOutrequires a hDC. ... Dim hOldBitmap As Long ...
    (microsoft.public.vb.winapi.graphics)
  • Re: Unknown pointer problem between Visual Basic and C
    ... the picture box must be visible for the drawing to take effect. ... - Does your C code cache the HDC for use later? ... Dim hbr As Long ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Unknown pointer problem between Visual Basic and C
    ... Draw into a picture area. ... except drawing from Visual Basic (HDC seems to be wrong). ... I send to the "Visual Basic wrapper" built in C, dimensions and DC pointer ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Clip capture
    ... does the picture box on the separate Form ... when you say you are "getting a negative number on the hDC" do you ... up the picture box to the size if the blit *and* do a PictureBox.Cls ... the bitmap is smaller than the blit, but with the "extra bitmap area" ...
    (comp.lang.basic.visual.misc)