Scaling A .SWF?
Jul 6, 2009How exactly would I go about making so that the .SWF file scales to the window's size?
View 1 RepliesHow exactly would I go about making so that the .SWF file scales to the window's size?
View 1 RepliesI am using the MSChart object in VB2010. Live futures data is put into an array, then added one point at a time to a line chart (Chart1, one line only) using (1):
frmChart2.Chart1.Series("data").Points.AddXY(sec10, spreadarray(0, sec10))
All fine and good. However, by the time a few thousand data points have come through, its getting hard to see the detail in the chart, therefore I reset the x-axis so that I just see the last 200 (say) points, using (2):
Chart1.ChartAreas("ChartArea1").AxisX.Minimum = frmPrices.sec10 - CLng(lstChartpts.Text)
...where frmPrices.sec10 is the total number of data points, and CLng(lstChartpts.Text) is the number of points required. So if I have 1000 pts, and I wish to see 200 displayed, the AxisX minimum in this case is 1000 - 200 = 800. Points then start to build again one at a time. I am happy with this except that the Y-axis scaling is still taking into consideration all 1000 data values, so need to reset the Yaxis maximum and minimum. No problem (3):
Chart1.ChartAreas("ChartArea1").AxisY.Maximum = (max of the last 200 values + a small increment)
Chart1.ChartAreas("ChartArea1").AxisY.Minimum = (min of the last 200 values - a small increment)
The problem comes in when I want to change the number of points to display back to "ALL". I could re-write the code to use the max and min of all values, as in (3), but I'd rather just reset the yaxis back to the autoscaling that the chart started out with. I've looked everywhere for a property or method to do this! Or is there a way to autoscale the yaxis according to only the displayed values?
So, I coded a graphics engine for myself. I can make meshes, save them, load them, rotate them, position them, scale them, and light them. Unfortunately, when I scale objects to a size other than it's original size, my lighting intensity changes (seemingly proportionally) with the scale of the object! Ambient light still works correctly though. Any suggestions?
View 4 RepliesI'm using the following code to print an image from a PictureBox. All works great except for scaling images down if they are bigger than the print page. Is there a method I'm missing to do this?
Screenshot, large image outside of the paper bounds:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AddHandler PrintDocument1.PrintPage, AddressOf OnPrintPage
[Code].....
I cant find how to scale the output to the printer. Currently the size of Form1 is set to A5 because that about the most the VDU can handle.When I send this to the printer from PrintForm1, naturally it prints at A5, ideally Id like to scale that up to A4 but cant find how to do it. It seems to me also that Id like to know that it was correctly centred to the paper.
View 1 RepliesAll I need to do is scale a panel to my co-ordinates X = 0-100 and Y = 0-100 and then plot a point (PSet?) at 50,50.
View 3 RepliesI am attempting to write a routine that will accurately scale an image to the specified size while keeping the original aspect ratio of the source image.Most [if not all] of the images that the program will be working with will either be 4x3 or 3x4 ratio and normally will be output at 800x600 or 600x800The thing that has me stumped at the moment is what kind of formula I would need to use to resize at image that does not meet the 4x3 ratio. Something like say a 600x255 image or a 255x600 or some other oddball size.
View 3 RepliesI created an image-viewing control for my boss that incorporates panning, zooming via the mouse wheel, and drawing a box to zoom to. The control needs to support very large image files (i.e. several thousand pixels on each side).
It all works, but whenever the code is scaling the image the control UI becomes unresponsive. My boss had me use threading to set the scaling code apart from the UI. The scaling code is now definitely on a separate thread but the UI is still bogged down while scaling code is running!
In my home form I have a splitcontainer and few buttons. When the buttons are clicked respective forms are opened in the splitcontainer. The splitcontainer is anchored- top, left, right, bottom so that when the home form is resized the splitcontainer resizes itself automatically. The controls within the other forms are also anchored properly to resize themselves accordingly. But the problem is when i open a form in the splitcontainer, even if I resize the home form, the controls in the form within the splitcontainer aren't resizing. The reason is when the home form is resized the splitcontainer is resizing itself accordingly but the form inside the splitcontainer isn't (as forms don't have anchor or dock properties so I couldn't set them). As a result though the controls in the sub form are anchored to resize themselves yet they aren't. How to solve it.In short I want the form in the splitcontainer and all the controls in it to resize automatically when the home form/splitcontainer is resized.
View 2 RepliesImagine I have a rectangle say 400px x 300px. All of this is very easy using Sytem.Drawing. DrawImage. But then I want to leave the left hand side as 300px but change the right hand side to 250 px. I can draw the box using 4 DrawLines but I don't know how to squash the image into the new shape. I want the right hand side of the shape to be 250, the left size 300 and the top and bottom 400px.I can't use DrawImage as it expects the left and right sizes to be the same. Is there a way to manipulate the image into the new shape?I've looked at other questions, but they only apply where the left and right hand side is equal.Any thoughts on how to squash an image into a shape which did not have parallel sides?
View 3 RepliesI've checked through most of the nfo I can find in forums about scaling a picture, but still haven't stumbled over the answer. ALl I want to do is print my form on the printer. The problem is I don't know what monitor the form is being dispayed on and how big or small the user has madt it. I just want it to fit on the printer when it is printed. Basically I want it to, "Fit the Page".
I thought I could do it by using a rectangle and adjusting the size of the rectangle to fit the 8.5 x 11 paper, All this seems to do is magnify my form on the printed page and clips the sides and bottom of the form instead of making it "fit" on the page. What am I doing wrong?
Here is what I am using: Public MyForm As New Bitmap(Me.Width, Me.Height) Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
[Code]...
Im currently in the mid of making a drawing project , and part of it is free drawing using Graphicspath object
now drawing is ok,moving or dragging the drawn path is done using System.Drawing.Drawing2D.Matrix but the problem is using System.Drawing.Drawing2D.Matrix object to scale the graphicspath object results into scaling and moving the drawn graphicspath on the same time ..
any resizing method code is listed below
Public Overrides Sub ResizeShape()
Dim Sqrt As RectangleF = GetBounds()
Dim Dx As Integer = MoveResizeEnd.X - MoveResizeBegin.X
[Code]....
I have a axwindowsmediaplayer object in my form which plays a video on load, but unfortunately the video seems too small and there is a massive black border around the video, is there anyway I can stretch the video to fill the whole player window?
View 1 RepliesI am new with VB.NET 2008 and I would like to know how to make a project so the forms will show correctly on various sizes of monitors. Do you have to put code in every form for this?
View 1 RepliesI have a picturebox that has an image on it. The user will be able to draw rectangles on that image, and the rectangle will have a string drawn into it. Frankly, I have no idea about the shape or size of these rectangles except to say that they will have a "reasonable" size to them. What I am trying to figure out is how best to draw the string inside the rectangle. Obviously, the size of the string is determined by the font, and I can measure this size with MeasureString in the Paint event for the PB. The size of the string as drawn must be less than the size of the rectangle such that the string fits entirely within the rectangle.
The problem is that MeasureString takes a font so that the size of the string can be determined in that font. That seems to require that I create a new font object, measure the string in that font, check to see that it is less than the width of the rectangle (don't have to worry about the height), and if the string is too big, reduce the size of the font and try again. This seems to have the potential to create and destroy plenty of font objects for the sole purpose of checking sizes. Is there a better way? How about a method that figures the maximum font size that can be used to get a string of pixel length X? The second half of this problem is something I haven't even begun looking at yet, but somebody has probably got an answer that will save me some time, so I'll toss it out here:It is possible that my rectangles will be high and narrow, in which case few strings will fit horizontally in the rectangle, so I might as well draw them vertically. Is there an easy way to draw text vertically rather than horizontally?
[URL]its a free hoster, so you have to wait 10 seconds.First here's the steps to replicate, then I'll explain what the problem is:
(1) Create a System.Windows.Forms.UserControl and add a button to the bottom-right hand corner. Leave the button anchor as default (top-left). Add some more buttons dotted around so that you can see that they scale correctly.
(2) Add the UserControl to a form in the construtor, after the InitializeComponent call.
(3) Run the form.
(4) Increase the form font size some way (eg click a form button).
All the controls within the usercontrol scale perfectly but the usercontrol itself doesn't. It's width and height are increased by way too much. Look at the margin now between the button at the bottom-right hand corner and the usercontrol.To correct the problem, the usercontrol must be added before the InitializeComponent call.If it wasn't possible for me to add the usercontrol before InitializeComponent, is there any way for me to correct the scaling?
I am trying to write program in vb 2010 that is independent of screen resolution. I am designing the program in 1920*1080 and when I change the resolution to e.g. 800*600 everything blows up and the program won't fit the screen. I have tried three different approaches:
loop through all controls and scale their position and dimensions
Friend Sub ResizeControl(ByRef ctl As Control)
'---------------------------- GET SCALES -------------------------
Dim DesignScreenWidth As Integer = 1920
Dim DesignScreenHeight As Integer = 1080
[Code] .....
None of these methods has worked for me. One thing I figured out was that my main form is larger than 800*600 pixels so when I run the designer in 800*600 resolution VS cut down the with to 812px so my calculations of with and thus scaling ratio becomes wrong. This error goes applies for all three methods.
I have a VB6 program in which all graphics are drawn with lines that are plotted to specific points in the controls (forms, picture box, etc.).
[Code]...
Finishing off my control, but I now found a nasty problem. When the user holds the 'Ctrl' key and scrolls the mouse scrollwheel, the control is scaled. I do not want that, since it would make the Font size fail.
I previously made it reset the scale on Control up, but that is just not a very elegant way:
Me.ZoomFactor = 1 I do not want the text scaled at any time, not even while the user is scrolling and it resets afterwards. I got to overriding the 'ProcessCmdKey' but no idea how to catch a scroll or zoom event.
Any way of disabling the RichTextBox scaling (or zooming) so it does not even occur? I have a control that inherits from the RichTextBox.
In my home form I have a splitcontainer and few buttons. When the buttons are clicked respective forms are opened in the splitcontainer. The splitcontainer is anchored- top, left, right, bottom so that when the home form is resized the splitcontainer resizes itself automatically. The controls within the other forms are also anchored properly to resize themselves accordingly. But the problem is when i open a form in the splitcontainer, even if I resize the home form, the controls in the form within the splitcontainer aren't resizing. The reason is when the home form is resized the splitcontainer is resizing itself accordingly but the form inside the splitcontainer isn't (as forms don't have anchor or dock properties so I couldn't set them). As a result though the controls in the sub form are anchored to resize themselves yet they aren't.
View 1 RepliesHow do I change the number of gridlines a chart displays? My chart data runs from 00:00 to 23:59 but due to the auto scaling I get gridlines and labels at funny time e.g 05:37 or 10:23. What I'd like is a label and line every hour but I can't find which property sets it!
View 2 RepliesI've got an app where the user uploads an image and the app resizes the image three different ways based on different variables. They all use the same image. I can't check to see if it's done using the image so I wondered if there was a way to check to see if the file is writable. A small loop that exits once it becomes writable (or "deleteable"). Working out of VB.NET.
View 1 Replies