BitBit With MSChart
Can you use BitBit to make a realtime MSChart Graph not flicker? I've looked through some of the threads here and they seem to mainly use pictureboxes for gaming. Is the principle the same, if so how would i implemet it?
Thanks
Sean
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Help With BitBit
Hello,
I am new to the gaming scene. I have picked up a little here and though however. I was wonder how to determine the size of the map window? Uhh...How to make it Show more of the map? The example I am looking at only has a small block, but I want to increase it to view more map at a time. Any suggestions on where to start?
Bitbit Help
hey i am making a character moving using bitblt to bit the character into a picture box
how to i make it so when i move the picture it will not leave the previous picture behind. so it will look like that character is moving.
thanks
BitBit Help
first off, what is Bit Bit, and how do you use it, can someone give me a good place to learn it from, tutorials or something, thanks in advance
Working With BitBit
Hi,
I've just began using BitBit now, so i'm not too good, i'm progressing slightly, but have a small problem...
Anyway, i've began making a square grid based maze game to get used to the functions of BitBit and cant seem to get something right, the game currently in no way resembles a maze, because I haven't started that bit yet...
To move the sprite properly, on a square-based grid i have set up an intXNow value to work with the intX, so that the character only moves so far at a time, by presetting intX to 10, then everytime you press to move, intXNow updates itself to equal intX, then runs the movement part on a timer...
Code:
Do Until intX >= intXNow + 50
-- movement code --
Loop
This works fine, but when you run it the first time he moves, he does four steps, the next time he does 5 steps, so he is no longer in the center of the x-axis grid...
I'm not sure what I have done wrong with this code.
Can somebody please look at my source code and tell me what i have done wrong to cause this uneven movement.
The source is in the zip below...
Your Help Is Greatly Appreciated.
Just Cant Understand BitBit!
Ok, ive tryed to understand this stuff for about 4 hours by now. And i just dont GET IT! I get NO ERRORS at all, but NOTHING HAPPENS either. So i wondered if anyone would post a newbie BitBit program for me.
thx
BitBit Error
When i try to initialize BitBit i get this error:
Help????
DLLImport - GDI32.dll - BitBit -
hi,
the Issue is ,
I would like to crop part of image. (I know the rectangle to be cropped from the tiff image). I tried DrawImage. But some Pixel Information is lost.
So I am trying to use BitBit approach.
My Code is ::::::
---------------Declaration - ----------------------
<DllImport("gdi32.dll", EntryPoint:="BitBlt", SetLastError:=True, _
CharSet:=CharSet.Unicode, ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function BitBlt( _
ByVal hdcDest As IntPtr, _
ByVal nXDest As Integer, _
ByVal nYDest As Integer, _
ByVal nWidth As Integer, _
ByVal nHeight As Integer, _
ByVal hdcSrc As IntPtr, _
ByVal nXSrc As Integer, _
ByVal nYSrc As Integer, _
ByVal dwRop As Int32)
End Function
Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
-----------------------
My function for cropping is
----------------------------
Dim g1 As Graphics = PictureBox1.CreateGraphics()
Dim imgCrop As New Bitmap(200, 200)
Dim g2 As Graphics = Graphics.FromImage(imgCrop)
Dim dc1 As IntPtr = g1.GetHdc()
Dim dc2 As IntPtr = g2.GetHdc()
BitBlt(dc2, 0, 0, 200, 200, dc1, 100, 200, SRCCOPY)
g1.ReleaseHdc(dc1)
g2.ReleaseHdc(dc2)
imgCrop.Save("c:Captured.jpg", ImageFormat.Jpeg)
MsgBox("Finished Saving Image")
------------
Error Msg :::
Unhandled Exception
PInvoke restriction: cannot return variants.
Anyone has idea about where I am doing wrong. Or any better approach for this
Transparency, BitBit() And Number Sorting
1. Transparency
Will a gif with a transparent background still have a transparent background on a form? If not then how can i get transparent backgrounds?
2. BitBit()
Unless it is very complicated and hard to explain could you show how to use BitBit() for animation?
3. number sorting
i have this code:
VB Code:
Dim dblAns As String Dim intDig As IntegerDim dbl As StringdblAns = "2856457889" For intNum = 1 To Len(dblAns) intDig = Mid(dblAns, intNum, 1) If (intDig Mod 2) = 0 Then If Len(dbl) Then dbl = dbl & ", " & Format(intDig) Else dbl = Format(intDig) End If Else dbl = dbl & Format(intDig) End IfNext intNum MsgBox "The numbers are:" & dbl
it splits the number 2856457889 into 2, 85, 6, 457, 8, 89
even numbers start a new number
rather than putting the split numbers into a string and displaying it in a msgbox i want it to load a new txtbox eg. txtNum fo each number.
thnx 4 help and i hope this post is more successful than last time
Make Bitmap Transparent With BitBit
Hi all -
Lets say I have a bitmap with a region that has been marked with a certain color to detone a transparent area - how could I go about BitBit'ing on top of another picture in VB so that the solid color becomes transparent? THanks
-Chris
Hmmm....bitbit Seems Easier Than Trying To Do Maps With An Editor?
Hello again,
I got my map working with bitbit, but the things are super small. I can barely see em hehe, anyone got a site that will show the break down of bitbit that what represents what? I had to just play with some and just do a row of numbers and see what I came out with. The last question is, to increase the actual size my bits display at do I need to increase the pixel size?
Thx for any help.
Questions: BitBit Moving, Walkmasks And Item Pickups.
Ok, so far have i quickly created a small program where a picture(the guy you control) moves instantly to the location of your click. Theres 3 things i must now:
1. How can i make my guy move slowly to the targeted location? not instantly.
2.How can i create walkmasks? Forexample if i create a tree, and i dont want my guy to walk right through the tree but around it.
3.How can i make my character pick up items? Forexample how can i make my guy get 10 score-points when he moves over an item, which in reality is a picture.
Edit*
I use BitBit.
This is not going to be a real game, iam just testing things out before i start creating a game.
Nothing is animated.
MSChart (Run-Time Error 13) When Trying To Create Object Of MSChart
Hello everyboy,
I am having some problems when trying to create an instance of an mschart object. I am writing a dll that should make up an chart from a recordset, but i have no interface to define mschart on to, so need to do it by my self. When i try something like this i get the runtime error 13.
Dim crt As MSChart20Lib.MSChart
Set crt = CreateObject("MSChart20Lib.MSChart")
If i try something like this:
Dim crt As MSChart
Set crt = CreateObject("MSChart")
i get the runtime-error 429, can't create activeX.
Is it possible to initialize mschart without putting it in a form, but initiating it directly from a module or a class, because my dll doesn't support any forms. I just wan to save a JPG picture of the chart i populated, so don't need to present the chart.
Thanks for any help,
Haris
Mschart
I want to produce a line chart from an ACCESS database with the following fields:
date
carrier
num_shipments
The user enters a date range. I want to put the dates on the x-axis and have a line for each carrier plotting num_shipments.
Mschart
I have a problem with mschart.....
... i refresh the data of mschart (60 data) with a timer every 500 ms
but on the video i see some flash in the mschart due to the refresh of data......can i eliminate these flashes? how?
can someone helpo me?
thank you!!!!
Al
How Can I Use MSCHART
i show an example in a visual basic book.
and i show the MSCHART what is this?
can i use this to make me diagrams? if yes how?
Using Mschart
Hi all,
I am developing a real time monitoring system in visual basic. I am getting the data continuously from the serial port. Using Mscomm, i am getting the data, and plotting the graph using mschart control. I am getting the graph perfectly.
The issue here is, We have some maximum and minimum limits whose value is stored in the database. The user needs to draw maximum limit and this minimum limit as a line over the real time graph(it can be 2D or 3D graph). Do you know how to draw this line over the graph whose value is taken from the database.
Pl. Help me out to solve this issue.
Thanks in advance,
Rgds,
dpr
MSChart
Dear all,
Can I include more than 4 series on MSChart? Can I have more than one type of chart on the same MSChart object?
Thanks in advance,
Nizam
Mschart
Ok, so the mschart control is what I'm using, but how do I send it data?
an array of points? (x,y,x,y,x,y,x,y) etc.
Mschart
Code:
Option Explicit
'This example shows how to plot multiple X-Y scatter graphs, also
'known as 2D XY, on an unbound MS Chart control. X-Y scatter graphs
'differ from other types because the associated DataGrid object needs
'2 columns per series, rather than just one. The first column for
'each series stores the X values, and the second one stores the Y
'values. Another difference is that if the # of plot points differs
'between multiple series, you have to remove the null points of the
'shorter series.
'Instructions: Add the MSChart control to your toolbox, then add
'it to a form. For clarity, try to make it at least 8 inches
'wide, by 5 inches tall, on the form. then, paste this code into
'the code window, and run.
'written by W. Baldwin, 8/2001
'OldRowCount keeps track of how many points have been plotted for
'the previous series, so we can remove null points from all the
'series that are shorter:
Dim OldRowCount As Long
'PenColor determines whether we are drawing in color or Black & White
'Black & White is for black and white printers, and uses different
'line patterns to distinguish series.
'ShowMarker is a flag that determines whether each plot point
'has a marker or not.
Dim PenColor As Boolean, ShowMarker As Boolean
'ChartPoints is the array that will hold the plot data
Dim ChartPoints() As Double
Dim lRow As Long, lRow2 As Long
Dim i As Integer, MsgPrompt As String
Dim XValue As Single, YValue As Single
Private Sub Form_Load()
With MSChart1
.chartType = VtChChartType2dXY
.ShowLegend = True
With .Plot.Axis(VtChAxisIdY).AxisTitle
.VtFont.Size = 12
.Visible = True
.Text = "Y Axis text"
End With
With .Plot.Axis(VtChAxisIdX).AxisTitle
.VtFont.Size = 12
.Visible = True
.Text = "X Axis text"
End With
.Title.VtFont.Size = 12
.Title = "Example 2D XY Scatter Graph"
.Legend.Location.LocationType = VtChLocationTypeBottom
.Plot.Axis(VtChAxisIdY).AxisScale.Type = VtChScaleTypeLinear
.Plot.Axis(VtChAxisIdX).AxisScale.Type = VtChScaleTypeLinear
'Tip from KB article Q194221:
.Plot.UniformAxis = False
.Footnote.Text = "Footnote goes here"
End With
PenColor = True 'Draw in color
ShowMarker = True 'Show plot points
ChartIt 1
PenColor = False 'Black and White
ShowMarker = False 'Don't show plot points
ChartIt 2
End Sub
Private Sub ChartIt(CurSeries As Integer)
MousePointer = 11
'Create a new array of plot points for this Series
'We will redim the first subscript differently, to show that each
'series can have a different # of plot points:
If CurSeries = 1 Then
ReDim ChartPoints(1 To 15, 1 To 2)
Else
ReDim ChartPoints(1 To 10, 1 To 2)
End If
'Create the array data:
For lRow = 1 To UBound(ChartPoints, 1)
'create the X and Y values:
XValue = lRow + lRow * 2
YValue = lRow + Rnd * 10
'create negative values for the 2nd series:
If CurSeries = 2 Then
XValue = XValue * -5
YValue = YValue * -1
End If
ChartPoints(lRow, 1) = XValue
ChartPoints(lRow, 2) = YValue
Next lRow
'We need to increase the ColumnCount. For X-Y Scatter graphs, we
'need 2 columns for each series.
MSChart1.ColumnCount = CurSeries * 2
With MSChart1
With .Plot
.Wall.Brush.Style = VtBrushStyleSolid
'Normally, you might want the Wall background of the Chart
'to be in color, if you're using Color pens, and to be white
'if using B&W pens, but, since we're drawing both a color
'series *and* a B&W series on *one* chart, we'll just make
'the wall color, for now. If you want White, uncomment the
'line found about 10 lines down:
.Wall.Brush.FillColor.Set 255, 255, 225
If PenColor Then
.Wall.Brush.FillColor.Set 255, 255, 225
'You can set the individual Pen colors here, or just use
'the defaults.
Else 'Based on an article in the VB KB:
'Uncomment the next line if you want the wall color to
'be white:
'.Wall.Brush.FillColor.Set 255, 255, 255
'Set the different patterns for Black and White plotting.
'You need to set the Pen for only the 'X' column:
Select Case CurSeries * 2 - 1
Case 1
.SeriesCollection(1).Pen.Style = VtPenStyleSolid
.SeriesCollection(1).Pen.VtColor.Set 0, 0, 0
Case 3
.SeriesCollection(3).Pen.Style = VtPenStyleDashed
.SeriesCollection(3).Pen.VtColor.Set 0, 0, 0
Case 5
.SeriesCollection(5).Pen.Style = VtPenStyleDotted
.SeriesCollection(5).Pen.VtColor.Set 0, 0, 0
Case 7
.SeriesCollection(7).Pen.Style = VtPenStyleDitted
.SeriesCollection(7).Pen.VtColor.Set 0, 0, 0
End Select
End If
End With
.ColumnLabelCount = CurSeries * 2
'If the current series has more plot points that the previous
'one, we need to change .RowCount accordingly:
If UBound(ChartPoints, 1) > OldRowCount& Then
.RowCount = UBound(ChartPoints, 1)
End If
'Both of the next 2 lines seem to do the same thing:
.Plot.SeriesCollection(CurSeries * 2 - 1).SeriesMarker.Show = ShowMarker
.Plot.SeriesCollection.Item(CurSeries * 2 - 1).SeriesMarker.Show = ShowMarker
'Create the plot points for this series from the ChartPoints array:
For lRow = 1 To UBound(ChartPoints, 1)
.DataGrid.SetData lRow, CurSeries * 2 - 1, ChartPoints(lRow, 1), False
.DataGrid.SetData lRow, CurSeries * 2, ChartPoints(lRow, 2), False
Next
'Remove null points from *this* series, if it has *fewer*
'points than the prior ones. If you don't remove null points,
'then the graph will add 0,0 points, erroneously. See MS
'Knowledge Base article Q177685 for more info:
For lRow2 = lRow To OldRowCount&
.DataGrid.SetData lRow2, CurSeries * 2 - 1, 0, True
.DataGrid.SetData lRow2, CurSeries * 2, 0, True
Next
'Remove null points from *prior* series, if this series
'has *more* points than the prior ones:
If CurSeries > 1 Then
For lRow = OldRowCount& + 1 To .RowCount
For lRow2 = 1 To CurSeries - 1
.DataGrid.SetData lRow, lRow2 * 2 - 1, 0, True
.DataGrid.SetData lRow, lRow2 * 2, 0, True
Next
Next
End If
'Store the current RowCount
OldRowCount& = .RowCount
.Column = CurSeries * 2 - 1
.ColumnLabel = "Series " & Str(CurSeries)
.Refresh
End With
SubExit:
MousePointer = 0
End Sub
Private Sub MSChart1_PointSelected(Series As Integer, DataPoint As Integer, MouseFlags As Integer, Cancel As Integer)
'MSChart1.Data = DataPoint
With MSChart1
For lRow = 1 To UBound(ChartPoints, 1)
'.DataGrid.GetData lRow, lRow * 2 - 1, ChartPoints(lRow, 2), True
Next lRow
End With
For lRow = 1 To UBound(ChartPoints, 1)
MSChart1.Data = ChartPoints(lRow, 2)
MsgBox MSChart1.Data
Next
'MsgBox MSChart1.Data
End Sub
i am using this example to do my graph, how can i click the data point to show the x value and y value??
Using Mschart
hi guys,
does any one knows how to plot line graph in real time using the mschart.
Using Mschart
hi guys,
does any one knows how to plot line graph in real time using the mschart.
Mschart
i plot a curve on the mschart.
1.) i want to show the curve as an animated curve, just from left to right around the data point and then plot it. Can i do this on the chart??
2.) i need to know the data point on the chart, like excel. when i click the data point, and automated show the value!!How can i do!!
Or other free active x can do this fastest!!
Thanks You for your help!!!
MSChart To *.gfx
Hiho,
i am just wondering if there is a way to convert a MSChart to any picture format like bmp,gif,jpq etc. ....
Thx 4 your Help
Seraph
Help With Mschart
hello, i have a problem with mschart, i;m trying to show the legend with the things i want to be shown but it doesn't work.
here is the code
Do While ii <= cantidad
Me.MSChart1.Column = ii 'columnNumber
Me.MSChart1.ColumnLabel = "Whatever"
ii = ii + 1
Loop
vcrearreportetecnologiafecha.MSChart1.ShowLegend = True
ii= counter
cantidad = number of series
what am i doing wrong?
thank you
Need Help MsChart !!!
Hey everyone,
I need your help, I am developping a SNMP manager, and I retrieve the CPU busy percentage from a Cisco 25xx series. with these value I draw a chart with Mschart component.
My problem is the following, I draw a point every 10sec, and the chart becomes quickly unreadable, do anyone know how to scale the chart, for example, delete the last row of the chart, in order to keep only the 10 last values ??
Thank for your help,
TouGY.
VB6.0 And MSChart
Hello!
1: Is there a way to turn the y-axis so that the negative values are above the x-axis and the positive values under it?
2: I have several fields in my table (Access). I need the values from the first field on the x-axis. What is the way to do it?
Thanks in advance!
MSChart
Is there anyway to Rotate the MSChart? Say for a better viewing angle. Some of the chartTypes, you are kind of looking down onto the graph and its hard to see the values.
MSChart
Is theere a way that you can place the mouse on a point (or actually select a point) and display the x,y values for that point.
I used .PointSelected and .PointActivated methods. They allow you to select a point (it places a little square marker on the selected point). This is great because I can use .DataGrid.GetData and display the x,y values in a text box. If I want to allow the user to use the arrow keys on the keyboard to move left and rigth, it does work and I get the x,y values correctly. However, the square marker that shows the selectd point does not show up. I need a visual indication as at which point I am. Any idea? Or any other way of doing it?
Thanx...
Mschart Help
Hi:
Using VB6, Access2000
I'm trying to use mschart with the following select. Iget the chart to display OK, but I'm not getting the legend (x axis) to display for some reason. All I get is R1.......Rx
Code:
RsSelect = "SELECT " & _
" CallLogWeekNo, " & _
" Count(*) as NumOfCalls " & _
" from " & _
" Calllog " & _
" Group by " & _
" CallLogWeekNo "
In turn using this select for another chart the x axis legend does display according to the data
Code:
RsSelect = "SELECT " & _
" IncomeYear & "" - "" & IncomeWeek as YearWeek, " & _
" Sum(IncomeReceived) as TheIncome " & _
" from " & _
" Income " & _
" Group by " & _
" IncomeYear, IncomeWeek "
Can someone help me with this?
Thanks
Help With MSChart
I have a two dimensional array with data in each dimension that I want to plot onto a graph in parallel e.g.
Array
dim 1 | dim2
12:00 9
13:00 10
14:00 8
15:00 15
I know how to get this array to the chartdata object but I am not sure how VB looks at it and plots the graph? is dim 1 the X axis and dim2 the Y?
if anyone knows about this or any helpful mschart knowledge I would love to see a response.
Thank you
Alex
Mschart
hi everyone,
I want to make a graphic with mschart, but this thing is new for me. I want to make the graph in y and x axis, the datas available in msflexgrid. How do I put the dots in the mschart with dynamic y and x axis values (the values determined by user)?. What must I do if I want to print the graph?
Thank you
regards
miwa
MSChart
I was searching how to save the graph from a MSchart so that I could copy and paste it onto a word document or something.
I found out that it should be something like this but I do not know how to write it correctly. Can any one point out what I am doing wrong?
Code:
MSChart1.EditCopy
Clipboard.GetData() ' I know this is where it gets bad
SavePicture = VBCFBitmap ' Here also
Thanks for any help
MSChart Help
can anyone tell me how to enter values into an array of values to an mschart control
MsChart Help Please
Hi everyone...i need to display in the same chart a xy scatter and a bar chart...i'm using mschart but i'm afraid it won't help me to acomplish my goal...is there any way i can solve my problem without having to buy a component ?
best regards,
diogo
MSChart
I'm trying to plot a range of data from my spreadsheet on a MSChart. I've got as far as the below but I can't set the source I want to plot as ".datasource" gives an error saying "method or data member not found".
Can someone help me out?
Code:
With MSChart1
.chartType = VtChChartType2dLine
.DataSource = objExcel.Sheets("Trades").Range("AD3:AD36")
.Title = "Portfolio Total"
.ShowLegend = False
End With
Mschart
Is there anyway to change the back colour of the MSchart, or specidy the colour range it uses for the data.
I have a lot of bars on my chart and it uses the grey colour which show up blank against its grey backgroud
Help For Mschart
hello,
I have a mschart.
It works fine but i have a problem like that.
I want to change some series color.
I mean.;
My array,
1 - 50
2 - 54
3 - 45
4 - 80
5 - 125
6 - 74
If my value is biggen than 100,how can i change the color red?
Best Regards
Help With Mschart
I'm using MSchart to display various graphical results most of the time they look good, but every now and then the width of the graph is too wide and the legend placed to the right goes partly off screen is there some property I can set for max width of columns or chart (not width of the whole control as this includes the legend)
MSChart
How can you draw a straight line across a chart? ie to represent a threshold, when i use the line from the menu it appears behind the chart??!?
thanks
Mschart
hi all,
how to make the column width of the bar graph constant?? so that when new data insert in the bar graph it will not resize the bar graph column width. if it can't be done in mschart, what are other active x or control can do this job??
MSChart
I want to change the color of a plotted line in MSChart on the fly. Can anyone tell me the member that will allow this? Can't seem to find the right command. thanks
Mschart
how can I set to runtime the property
devisions per label
devisions per tick
please help and thanks!
braemi
MSChart Help
hi,
is it possible to have the rows of a mschart control a fixed length, as i want the actual chart to grow wider when data is added, (instead of the rows getting smaller)
my aim is to have a scroll bar along the bottom which can enable a user to scroll to the end of the graph if it is too wide to go on the screen
any help would be great!!
david
MSChart
hi
having a spot of chart problem!!
how can i have fixed rows at a certain width and as i add rows the actual chart grows wider, and how could i implement a horizontal scroll bar to view the chart when it goes off the end of the screen.
thanks
david
MsChart
Hi,
I'm writing a program that trains neural nets. A complete training cycle consists of 150 steps, and there is a value (rsq, a double) that represents the accuracy of the net so far, which ranges from 0 to .9999999. After a certain point, it is pointless to continue training because it is as accurate as it is going to get, which is a visual judgment call. When the rsq flattens out, you might as well stop. I want to chart the rsq. I am trying to use Ms Chart to do it, but it doesn't seem to make any sense and the documentation doesn't seem to say much of anything. I don't want labels. All I want is a chart that goes horizontally 1 to 150 (the steps), with a line that shows the rsq (0 to 1) scaled to the height of the chart. The chart is on a form with a black background, so I want to have a white background for the chart itself and the line to be red or blue. I feel like I have tried everything, but it just doesn't make any sense.
Dim arrData(1 To 150) As Double 'this has the rsq in it
MSChart1.ColumnCount = 150
MSChart1.RowCount = 100
MSChart1.Title = ""
MSChart1.ChartData = arrData
When I try to run this, I get a grid 100 x 100 with nothing in it. The chart type is 2dYX. Anyone have any ideas? Also, it takes a very long time to run the program when I have the chart in it.
Thanks.
MSChart To BMP
I searched but could not find- Any ideas on how to save a MSchart object to a BMP or JPG file.
Thanks
MSChart
Could anyone please tell me how can I change appearence of Lable in MSChart in VB 6.0? I want lables for Bar chart appear on diagonal at the bottom of the chart but can't find how to achieve it? Please, help!!!
MSChart
I'm trying to plot data from an array (intCamsA) onto a line chart (chtTest). From researching the forums I read that .chartdata can be used to directly load the data from the array. However.......
With chtTest
.chartType = VtChChartType2dLine
.chartData = intCamsA
End With
doesn't seem to work, I just get a blank chart.
Mschart
Hi,
I have been having this problem and have been unable to figure it out. It involves the Z axis on an MSCHART. The problem is that it is not expanding. I have attached a picture so you know what i mean, the problem area is outlined in a pink square. The charts is set to a 3d line type. This is the last part of the section of the program i am working on and i need to move on. I just cant figure this out. Any help would be great. Thanks
|