Questions tagged [system.graphics]
13 questions
4
votes
4 answers
Graphics.DrawImage creates different image data on x86 and x64
Hey there!
Here is my setting:
I've got a c# application that extracts features from a series of images. Due to the size of a dataset (several thousand images) it is heavily parallelized, that's why we have a high-end machine with ssd that runs on…

mfeineis
- 2,607
- 19
- 22
3
votes
1 answer
How to get bitmap from painted panel in C#
I have a panel and I use it's Graphics gr = panel1.CreateGraphics() to draw lines and other stuff. I need to get pixel color of the point where mouse is clicked, so I decided to use GetPixel method of Bitmap. I create bitmap this way:
Bitmap b = new…

mindmaster
- 1,705
- 3
- 16
- 18
3
votes
1 answer
DrawImage fails to position sliced images correctly
For a couple of days now I've tried to figure out why my nine-slice code does not work as expected. As far as I can see, there seems to be an issue with the Graphics.DrawImage method which handles my nine slice images incorrectly. So my problem is…

Dan Persson
- 81
- 5
3
votes
0 answers
Why converting big TIFF to JPEG has generic error?
I used this code for converting tiff to png before:
using (MemoryStream inStream = new MemoryStream(tiffBytes))
{
using (MemoryStream outStream = new MemoryStream())
{
System.Drawing.Image.FromStream(inStream)
…

n.y
- 3,343
- 3
- 35
- 54
1
vote
3 answers
Best way to store sets of images for Windows Forms
I am developing a windows forms applications and I will use sets of images (think icons). Depending on the theme, different sets of images must be chosen (I will later draw them using a Bitmap).
I was thinking of storing the images in separate files…

csq
- 11
- 1
- 2
1
vote
1 answer
scottplot xticks not showing
I have the following graph, where the labels defined through a call to xticks() are not showing for scottplot, anyone knows why?
Cf. picture hereafter and corresponding code snippet
var plt2 = new ScottPlot.Plot(800, 600);
…

Steven De Bock
- 429
- 4
- 21
1
vote
0 answers
Possibility to create live preview of WinForms form/control c#
I'm looking for possibility to create a live preview of WinForms Form/Control.
My application got two windows - one, where someone can draw on Image (which is in PictureBox), and second window, where someone can see what was been drawn on 1st…

Hawex
- 133
- 13
0
votes
0 answers
Trouble displaying image in PictureBox with Zoom and Pan
I'm having some trouble displaying an image in a PictureBox in my Windows Forms application. I want to zoom and move the Bitmap inside the PictureBox. I have an object RectangleF that hold the location and the size of the Bitmap inside the…

Christian Cascone
- 423
- 4
- 14
0
votes
1 answer
Correctly cutting an image out of a pink back grid image to draw
Take a look at the image above. I'm creating a (recreation) of a tile-based game. In my other sprites, I've simply been placing the terrain squares into the grid, they are solid so there was no problems. The problem here is that, if I use this…

Freesnöw
- 30,619
- 30
- 89
- 138
0
votes
1 answer
How to determine points along a GDI+ path
Does GDI+ (System.Drawing.Graphics in .NET) offer some method to determine points on a graphics path?
Specifically, I'm hoping to find an easy way to write the following function:
Point positionAt(GraphicsPath path, Single where)
with where a…

reinierpost
- 8,425
- 1
- 38
- 70
0
votes
1 answer
Shown doesn't work
public void GridCreate()
{
Graphics g = pictureBox1.CreateGraphics();
SolidBrush brushBlack = new SolidBrush(Color.Black);
Rectangle[,] block = new Rectangle[16, 16];
for (int i = 0; i <= block.GetLength(0) - 1;…

Борис Кот
- 125
- 1
- 6
0
votes
1 answer
Adding a vertical scrollbar to a panel if drawn area is too large
I'm using WinForms and C#.
The application I am developing draws rows of rectangles (using g.DrawRectangle()) inside of a panel. The panel can hold 6 rectangles in width (I don't want to have horizontal scrolling). I control this within the…

Logan Serman
- 29,447
- 27
- 102
- 141
-1
votes
1 answer
Saving System.Graphics to bitmap not working
I've created program for drawing. It uses System.graphics to draw rectangles etc. on panel1 in form.
Graphics
Mouse draw event:
Draw
I want to get art from panel1 as a bitmap, tried this code:
using (var bmp = new Bitmap(panel1.Width,…

An Example User
- 23
- 1
- 8