Jump to content
Xtreme .Net Talk

solokin1

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by solokin1

  1. sorry, i meant to say second to third Sorry, in my description of my code I meant to say it copies from the first to the second, and then from the second to the THIRD. Thanks, Solokin1
  2. Hi, I am currently using the GDI function DrawImage as a substitute for Bitblt in the good old VB6 days (sigh) and as it turns out I cannot copy an image through two pictureboxes! Can someone please tell me what I am doing wrong in the following code: I have three pictureboxes, and the first has an image in it. I am copying from the first to the second, and then from the second to the first. It copies from the first to the second just fine, but when it tries to copy from the second to the third it gives me an error of "Object reference not set to an instance of an object." ' Dimension a graphics object for the two other pictureboxes. Dim g1 As Graphics = PictureBox2.CreateGraphics Dim g2 As Graphics = PictureBox3.CreateGraphics ' Dimension a temporary rectangle. Dim tempRect As New Rectangle(0, 0, 50, 50) ' Copy from the first box to the second. g1.DrawImage(PictureBox1.Image, tempRect) ' Copy from the second box to the first. g2.DrawImage(PictureBox2.Image, tempRect) Thanks in advance, Solokin1
  3. Hi, Thanks for the info on creating a bitmap image in memory, and now I have a question on how to draw an image transparently on a picture box, using drawimage. What I have in mind is something like the following function: TransBlt(srcImage As Image, srcRect aS Rectangle, destImage As Image, destRect As Rectangle, transColor AS Color) What would be the source code for this? Thanks a lot, Solokin1
  4. hi, I just recently switched over to VB.Net in the midst of my coding a Diablo II-clone, and I have noticed that there is no BitBlt function, so I tried using the GDI DrawImage method. This works fine if I am loading a bitmap from disk into a picturebox, but I cannot then copy a selected rectangle from that picturebox into another picturebox! It says that there is no image in the previous picture box, and so it can't copy the selected portion! Is there something I;m doing wrong or should i use directdraw9 or what? Help requested before I physically burn my copy of VB.NET :) SOloKing
×
×
  • Create New...