i am already mad at the fact that control arrays are gone..Is the syntax for BitBlt that same from vb6 and vb.net? Can i still use the vbSrcAnd, vbSrcCopy, and vbSrcPaint?I have seen some things on going around control arrays, but how would i do some control arrays for bitblt? i tried
Dim picPicture(0) as picturebox
Dim i
for i = 0 to 10
redim preserve picPicture(i)
picPicture(i).Image = Application.Startuppath & "img" & i & ".bmp"
next
I am trying to use Bitblt for drawing one image on another. but when i try to get HDC From first image it gives Negative pointer value, so BitBlt returns 0 value. is it possible to get device context from bitmap directly?
I was told to use bitblt to crop my image. But i am new to vb and am really confused as to how to do it. I am making a board game. The player chooses its colour of player (a pawn),this image is then placed on the board. I want just the pawn to show and not the box around it.
Edit: Fixed, I created a compatibleDC for the graphics object, and a handle for the bitmap (using b.gethbitmap), then used the SelectObject function inside GDI to select those two, and used the compatibleDC instead of hDc in the BitBlt function I've been trying to draw a bitmap to the screen (device 0), however I have encountered a problem copying the graphics using BitBlt.
Initially, I was drawing directly to the desktop using SetPixel (gdi32), but it was slow, so now I am setting the pixels of a bitmap object and then creating graphics from that object, and copying the hdc of the graphics to the screen.My guess is that I am adding the HDC of the graphics object to an intptr, which essentially gives me the HDC of the container of the graphics object, which is not what I need. However even so, I have not found any information on how I could copy a bitmap to a device other than using BitBlt.
This is my current code (Windows forms app, textbox, button) The textbox is the device to copy to, and the button starts it. For testing purposes, set the textbox text to 0, and press the button. You should see a black box (50x50px) in the top left corner of your screen. The colour should be blue if it is working correctly:
Public Class Form1 Declare Function GetDC Lib "user32.dll" (ByVal hwnd As Int32) As Int32 Declare Function ReleaseDC Lib "user32.dll" (ByVal hwnd As Int32, ByVal hdc As Int32) As Int32
[code]....
The way it works is it calls the function setpx, given a location and color from within a loop iterating through all of the pixels in a box (50x50 in my code). The setpx function will then call the setpixel fuction on a bitmap b. This part is working fine.Next, it will define a graphics object g from the bitmap, and I use BitBlt to copy g's hdc (g.gethdc) to the screen. This is not working correctly?
I use vb.net 2005.I want to take one image and place it on top of another image, I want to blend the images using various techniques such as OR or XOR od AND functions.I understand BitBlt does this.1) Is this the technique i should use in .net? Or is there some complicated parameters burried deep in the graphics.drawimage method?2) How do i declare the BitBlt function and what are the values of the ROP parameters?
It's several years since I last used BitBlt and the like in VB6, and I'm just refreshing my memory with a little sample app before using it on the current project I'm working on in VB2005. I've come up with the following:
Finally "upgraded" to vbnet and got no idea how to do this! What I'm doing is using bitblt to take a screenshot of the desktop and put it in a picturebox. What I really need is just the raw data from the picture, not the picture showing on a picturebox.
Only problem is that it is not working at all!
Here is the entire sourcecode. How is it not working??
Module1 Module Module1 Public Declare Function GetDesktopWindow Lib "user32" () As Long Public Declare Function BitBlt Lib "gdi32" (ByVal hDCDest As Long, _
I'm using BitBlt and GetDC to capture windows and save them to a bitmap, but a window that is covered or overlapped by another window appears with that window showing over top of it. Is there a way to stop this from happening? I have the window handle available, the graphics context, and a Process object.
I have a BitBlt wrapper function in my VB project. It works just fine when compiled as Any CPU, but when I aim it at x86 it creates an empty bitmap. I must use x86 as other parts of the app require it. Here is the code:
Imports System.Drawing.Imaging ''' <summary> ''' Provides the static method ControlCapture used to ''' take screenshots of the specified control.
In VB6 you could BITBLT things around before refreshing the screen. In .NET, I'm aware of DrawImage, but that can only be done on a paint event rather than before anything gets painted. The issue I have is, I need to open several files with image data in them and then build a bigger image with those smaller images. Before I could open them, BITBLT them to a Buffer. As far as I can tell .NET offers no way to do this as the only function I've been able to find (DrawImage) only works within the paint event. Is there still a way to do this in VS08 or no?
I am having an issue trying to figure this out. I am writing a script editor that uses tabs (a tab control) and I want to implement syntax highlighting. My issue is that every sample I can find on syntax highlighting uses
Private Sub RichTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
i have this code:Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[Code]...
Error 1: Option Strict On disallows late binding.Im using visual basic 2010 express on a gateway laptop thats running Windows 7 OS How do i resolve this error?
I have a listbox and it it I am showing numbers.It should look like this (line by line) 1,2,3,4,5,6,7,8,9,10,11.....but is is showing it like this 1,10,11,...2,20,21...3,30...ow can I make it that it will show it in number order 1,2,3,4,5......
I want to select some rows from a sql express 2005 table. I am using this expression: "Starttime >= " & dtpStart.Value dtpStart is a DateTimePicker But I am getting this error: Syntax error: Missing operand after '14' operator.
SELECT dbo.Calls.Description, dbo.TicketRead.IsRead, dbo.TicketRead.UserID FROM dbo.Calls LEFT OUTER JOIN dbo.TicketRead ON dbo.Calls.CallID = dbo.TicketRead.TicketID WHERE dbo.TicketRead.UserID = 1 or is null
I want to get a list of all calls, but also a value indicating if the user have read the call. so I made when a user open's the ticket a new record is added in a special table. now if no user have read it then it's ok, but if just one user have read this ticket, then the other users don't have this call in the list..
just starting out to learn vb.net. I am doing so cuz i have some vba stuff i need to port.orry for the beginner question: translate this code I use in Outlook to vb.net? I know it's not complete, but I am stuck here.
Private Sub Application_ItemSend(ByVal Item As Object, ByVal Cancel As Boolean) Dim objNS As NameSpace im objFolder As MAPIFolder
The following is from a WCF sample I am working on.
<ServiceBehavior(InstanceContextMode:=InstanceContextMode.Single)> _ <Foobar()> _ Public Class Service1
I've never understood this and just used examples, but I would like to understand what is going on here. What exactly is the stuff inside the <> brackets? How are these related to Service1? I understand the ServiceBehavior is related to the hosting, but what about Foobar?
I'm trying to display an aggregate feed of several RSS feeds. I'm doing this with an asp page.The problem is I'm getting the error message:Microsoft VBScript compilation error '800a0401' Expected end of statement for the line:Dim feed As SyndicationFe
Dt = MyMod.GetDataTable("SELECT TOP " & QuestionsPerCats(i) & " * From Questions WHERE CategoriesID ='" & Cats(i) & "' ORDER BY NEWID()")
but now i decided to use sqlparameters like
Dim cmd As New SqlCommand("SELECT TOP @QuestionsPerCats * From Questions WHERE CategoriesID = @CategoriesID ORDER BY NEWID()", conn) Dim sqlParam As SqlParameter = Nothing sqlParam = cmd.Parameters.Add("@QuestionsPerCats", SqlDbType.SmallInt)
i hope to create an application to check vb.net syntaxes (for simple function or methoe). Application will be given richtext box to add function or method and when submit, need to check that vb.net syntax and it will be execute by powershell.
Is there any differnce between the following syntax? Im thinking that there isnt, as long as the end result of the "AS" portion has RuleType named "AS R.RuleType." Notice that the first snippet of code has the R.RuleType and the second has just Rule.Type.strRule.Append(
"select R.Ruleid,R.RuleNumber,isnull(C.ClientName,'') as ClientName,R.Customerid,Case R.RuleType when 'R' then 'P' when 'B' then 'G' else R.RuleType End as R.RuleType,isnull(C.InternalClientID,'') as InternalClientID,")
im trying to do a basic calculation and i get a syntax error on what ever if first on the bottom line of this code :
[code].....
at the error is on the bracket on the bottom line but when i remove it , the error goes onto the 805 .everything is declared properly in a module. as integers?
It was suggested that I use xmldocument.load to do a sql insert statement instead of BULK INSERT.However when I run the Sub I am getting this error: "Incorrect syntax near '<'. "Here is my code, I have no clue what is causing this error, or how to fix it.
Sub AO() Dim Z As String = Microsoft.VisualBasic.Format(Today.AddDays(-1), "MMddyyyy") Dim AO_Name As New String("\NetImportAO-M_" & (Z) & ".xml") Console.WriteLine(AO_Name)