|
I've never heard before that PNG is compressed is there an uncompressed PNG format?
I'm currently learning C++ but I'm only on the beginning so I can't move that fast to XNA, cause as I know XNA requires C++ or C#.
|
|
|
|
|
O.G.I. wrote: I'm currently learning C++ but I'm only on the beginning so I can't move that fast to XNA, cause as I know XNA requires C++ or C#.
Nothing like trial by fire right? You could always give a try and post questions when you get stuck.
Ping compression details
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hi,
I don't see where the image's fileformat would be relevant, assuming you load the images into memory once (hence outside your drawing methods), which turns them into uncompressed bitmaps anyway, e.g. using Bitmap bm=Bitmap.FromFile(filepath); or something similar with FromSream. (example is C# syntax!).
PS: I strongly object to your code swallowing exceptions; if you (think you) need a try-catch, then do something useful with the exception, e.g. display it's Exception.ToString().
[ADDED]And if there is a very specific exception that you rightfully want to ignore, add a catch for that specific exception and insert a comment as to why it is OK to ignore it; then leave the more general catch out, or put some code in it.
[/ADDED]
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
modified on Thursday, June 25, 2009 10:44 AM
|
|
|
|
|
how can i fire a form through tree view node click event.
|
|
|
|
|
Create object of the form and use Show or ShowDialog method (as applicable).
|
|
|
|
|
thanks for u r replay my problem is in the tree node selction program
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
Dim childnum, index As Int32
childnum = TreeView1.SelectedNode.GetNodeCount(False)
index = TreeView1.SelectedNode.Index
'index = index + 1
If index = 0 Then
Button2.Show()
GroupBox1.Show()
End If
End Sub
The Above function is not working for me to select tree node and fire,is there any thing wrong in tn my prg.
|
|
|
|
|
I'm not sure I'm completely following you here. The controls are displayed when the index is 1 right? What else are you expecting to occur?
Also, check that you have at least 2 nodes in the treeview since the index is zero based.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I tried the aabove code by making a button visable false and on selcting a perticular treenode it will appear but the same code is not working for the group box that consits of some group of buttons.
I want make that group box visable when i click on a perticular treeview node.
|
|
|
|
|
I tried the aabove code by making a button visable false and on selcting a perticular treenode it will appear but the same code is not working for the group box that consits of some group of buttons.
I want make that group box visable when i click on a perticular treeview node.One more thing i have i have 8 child nodes for my tree so thre is no problem of zero index base.
|
|
|
|
|
Your code looks like it should work. Check the visible property (should be true) on the button controls in the group box to see if visible = true. If not, you'll need to change that at design time or during run time looping the groupbox's control collection.
Quick test app you can do.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'add a group box and stuff with button controls
For Each ctl As Control In GroupBox1.Controls
ctl.Visible = True
Next
GroupBox1.Visible = False
End Sub
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
If e.Node.Index = 5 Then
GroupBox1.Visible = True
End If
End Sub
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Thanks Jon_Boy Your code is working for me.
|
|
|
|
|
TreeViewEventArgs has all the properties you need. You can use them right away.
Apart from that what exactly is the problem you are facing.
|
|
|
|
|
How does one initiate windows hyperlink dialog selector. By this I do not mean the link label. There is a dialog that is called in C++ with "using (LinkDialog dlg = new LinkDialog())"
With the other dialogs you (color, font, etc) you add them via a control in the toolbox, but I do not find a LinkDialog.
Many thanks
|
|
|
|
|
There is no using statement in C++. Also, if a control exists in MFC, does not mean it exists in .NET. Do you have a link to the control you want, in MSDN ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi Christian,
Ok you are correct. I am currently busy converting a project from C++ to VB.NET (why I dunno but here I find myself doing this) I only notice now amongst the millions (ok not quite millions) of classes and forms and other resources that the previous guy made a LinkDialog class which basically has a textbox to indicate what text must be show and a URL textbox for the link and a dropdown to select target. So that is where it comes from.
So basically I just make another one. Thank you
|
|
|
|
|
Program that someone else wrote. (ProgA)
Program that I wrote. (ProgB)
DLL that someone else wrote (i have the cls file) and I have modified. (DLL1)
I have sample code with an attempt to accomplish my goal if needed.
When ProgA sends a message to DLL1, I need ProgB to see the results of the call from ProgA to DLL1.
|
|
|
|
|
A dll can't call your main app. So, you want to load the same dll instance into both programs. I am not sure if that is possible. Your best bet IMO would be for the dll to use WM_COPYDATA or similar to communicate with the other program, or create some sort of shared storage for the dll to use between instances.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Agreed in that there should be some way to store the info so that both apps can access it.
Is it possible to relaunch app2? If so, you could restart app2 and pass in command line args to have it process whatever needs to be done.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
My goal is to get the RGB colors of a pixel when I click in a picturebox. Every piece of code I've been able to try or find doesn't work. The bit below uses the GDI GetPixel function and should work but returns an Overflow error. I'm using VB 2008 Express.
Dim p As Point = picbox.PointToClient(MousePosition)
Dim g As Graphics = picbox.CreateGraphics()
Dim pbdc As IntPtr = g.GetHdc()
Dim c As Color = ColorTranslator.FromWin32(GetPixel(pbdc, p.X, p.Y))
g.ReleaseHdc(pbdc)
|
|
|
|
|
You seem to be trying to get a pixel from picBox's display context. Is this what you want? If so, then you can simple use (picBox.Image as Bitmap).GetPixel(p.X, p.Y) instead. However, that's just the basic idea. You'll probably want to split it up into separate lines, and add a null-check from picBox.Image. If that's true, you'd probably just want to return a color with 0 transparency
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Thanks Computafreak, that did the trick. It's always the simplest answer that's the right one.
|
|
|
|
|
Public Function DecryptString128Bit(ByVal vstrStringToBeDecrypted As String, ByVal vstrDecryptionKey As String) As String
Dim bytDataToBeDecrypted() As Byte
Dim bytTemp() As Byte
Dim bytIV() As Byte = {121, 241, 10, 1, 132, 74, 11, 39, 255, 91, 45, 78, 14, 211, 22, 62}
Dim objRijndaelManaged As New RijndaelManaged()
Dim objMemoryStream As MemoryStream
Dim objCryptoStream As CryptoStream
Dim bytDecryptionKey() As Byte
Dim intLength As Integer
Dim intRemaining As Integer
Dim intCtr As Integer
Dim strReturnString As String = String.Empty
Dim achrCharacterArray() As Char
Dim intIndex As Integer
bytDataToBeDecrypted = Convert.FromBase64String(vstrStringToBeD...
intLength = Len(vstrDecryptionKey)
If intLength >= 32 Then
vstrDecryptionKey = Strings.Left(vstrDecryptionKey, 32)
Else
intLength = Len(vstrDecryptionKey)
intRemaining = 32 - intLength
vstrDecryptionKey = vstrDecryptionKey & Strings.StrDup(intRemaining, "X")
End If
bytDecryptionKey = Encoding.ASCII.GetBytes(vstrDecryptionKe...
ReDim bytTemp(bytDataToBeDecrypted.Length)
objMemoryStream = New MemoryStream(bytDataToBeDecrypted)
Try
objCryptoStream = New CryptoStream(objMemoryStream, objRijndaelManaged.CreateDecryptor(bytDe... bytIV), CryptoStreamMode.Read)
objCryptoStream.Read(bytTemp, 0, bytTemp.Length)
objCryptoStream.FlushFinalBlock()
objMemoryStream.Close()
objCryptoStream.Close()
Catch
End Try
Return (Encoding.ASCII.GetString(bytTemp))
End Function
i have got this cod to encrypt a string i want it to be written in perl
Is it possible
can anyone help me out with this please
help me iam shaking my head for about a weak to do tyhis
|
|
|
|
|
1. Where's the formatting?
2. What exactly are you asking? If its encrypting/decrypting a string, what's the problem?
3. Your grammar is horrendous.
Other than that, everything looks fine.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
The question was at the bottom of the code....
harieshkumar.n wrote: i have got this cod to encrypt a string i want it to be written in perl
Is it possible
The answer is probably yes.
However, I suspect you are after someone to write the code in perl for you?
If not.. show us what you've written so far in perl and we'll see if we can spot what you've done wrong
|
|
|
|
|
Jon_Boy wrote: Your grammar is horrendous.
Why, what did she do ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|