How to paint a point in a picture box in visual studio 2012.
in visual basic 6 it Written:
picture1.pset (x,y) , vb(color)
You could create a Graphic object from the picturebox and draw on that:
Dim g As Graphics = PictureBox1.CreateGraphics()
g.DrawRectangle(pen, x, y, 1, 1)
See System.Drawing.Graphics
Related
I am making a watch application for Samsung Gear S2 with EFL Native application.
Problem was happened when I rotate hands of the watch.
Look at following image.
This is normal image I paste it to evas_object and it's not rotated yet.
After I rotate it, the edge of hands has changed to jagged shape like it.
Resolution of gear s2 is 360px X 360px so I make every image is fit to this size.
And I rotate image with following code.
Evas_Map *m = NULL;
m = evas_map_new(4);
//evas_map_smooth_set(m, true);
evas_map_util_points_populate_from_object(m, obj);
evas_map_util_rotate(m, degree, cx, cy);
evas_object_map_set(obj, m);
evas_object_map_enable_set(obj, EINA_TRUE);
evas_map_free(m);
I was try fix it with evas_map_smooth_set() function.
EFL document is written to this setting makes image to "SMOOTH"
and default setting is "true". but I worried tizen change it to "false".
But jagged shape is still showing Despite after I set true or false.
The Watchface that created by "Gear Watch Designer" has not jagged image on rotating there hands.
How I can rotate Image without jagged edge?
OK finally I found why jagged edge is appear on rotating.
In the emulator or my gear s2, default EFL rendering engine is not opengl backend.
So I can fix it with following codes.
elm_config_accel_preference_set("opengl");
Write this code before create window (elm_win_add) it will make anti-aliased image on rotating image.
Sorry for the very late answer, but I believe you can fix this issue in two ways:
Call evas_object_anti_alias_set() on the evas object that is mapped.
As you've mentionned in another answer, use GL acceleration but you may even want to enable MSAA on the backbuffer: elm_config_accel_preference_set("opengl:msaa");
How do I control the visual stacking order of images and colour bars in Matlab?
I have 6 images that I show on a 2 x 3 grid using subplot. I add colour bars to each of the images, but some of the colour bars appear behind the images, rendering them invisible. In my example, colour bars belonging to image 3 and 5 (counting as in the subplot command) appear behind their respective images.
I do not think I will be able to use the order of axes children objects, as each axes apparently only has one child, i.e. the image, and the colour bar object is child of the figure (Must be the same as its associated axes).
I have also tried uistack (with top for colour bars, and bottom for images), and although it does change appearances, in the end, other colour bars will wind up behind the images. It seems random which ones, for example after uistack on the image and colour bar belonging to subplot 5, the colour bar of subplot 2 will suddenly appear behind its image.
PS I also tried reordering the children of the figure, but they do not change (even with painters render)
It is very strange: When I just prepared the MCVE, the problem did not reproduce, but I have no idea what is different! Maybe a Windows update? Anyway, the original output with the problem is shown here http://i.stack.imgur.com/LJVG2.png, and the prepared example output which looks as it should here http://i.stack.imgur.com/F1LMX.png. So for now, there is no problem...
The code is
function example()
I1=ones(96,96);
I2=ones(96,96)+1;
I3=ones(96,96)+2;
I4=ones(96,96)+3;
I5=ones(96,96)+4;
I6=ones(96,96)+5;
pos=[10 10 12 9];
fig=figure
fig.Units='centimeters';
fig.Position=pos;
set(gcf,'PaperPositionMode','auto');
h(1)=veryTightSubPlot(2,3,1);
imshow(I1,[0,6]);
h(2)=veryTightSubPlot(2,3,2);
imshow(I2,[0,6]);
h(3)=veryTightSubPlot(2,3,3);
imshow(I3,[0,6]);
h(4)=veryTightSubPlot(2,3,4);
imshow(I4,[0,6]);
h(5)=veryTightSubPlot(2,3,5);
imshow(I5,[0,6]);
h(6)=veryTightSubPlot(2,3,6);
imshow(I6,[0,6]);
V=[0.315,0.65,0.97,0.315,0.65,0.97,0.315,0.65,0.97];
for i=1:6
p=get(h(i),'Position');
c=colorbar(h(i),'Axislocation','in','FontSize',8);
c.Color=[0,0,0];
cp=c.Position;
h(i).Position=p;
cp(3)=cp(3)/2;
c.Position=[V(i) cp(2:4)];
end
colormap(parula);
end
function [ax] = veryTightSubPlot(rows, columns,index)
ix = mod(index-1,columns);
iy = floor((index-1)/columns);
pos = [ix/columns,1-(iy+1)/rows,1/columns,1/rows];
ax = axes('ActivePositionProperty','outerposition','Position',pos);
end
I'm reading live feed from a mono camera and need to take a snapshot when pressing a button.
So when I convert the pointer the camera passes me to a bitmap (8 bpp) for further image processing,
the colors get all weird like this
I'm guessing it's because I didn't set the palette of the bitmap correctly, so I googled some and
came across some code in VB, which sets the color palette of a bitmap to gray scale.
I want to do the same in C++ under Visual Studio 2010, only in C++ the constructor of color palette is sealed,thus I have no way of declaring a new grayscale palette and then assign it to my bitmap.
Below is the example code I found written in Visual Basics :
Dim bmpobj As Bitmap
Dim pal As System.Drawing.Imaging.ColorPalette
pal = bmpobj.Palette
For i = 0 To 255
pal.Entries(i) = Color.FromArgb(i, i, i)
Next
bmpobj.Palette = pal
So what I'm asking is this : Is there anyway to set my bitmap's palette to grayscale ?
I think, just by changing the color palette, your image won't change to gray scale.
You will need to change each color pixel in the image to gray scale. The algorithms are here.
i want to know how to get coordinate (x,y) of 2 Textboxes and compare each others, i saw some code use GeoCoordinate then i try it but i don't know why my visual studio doesn't support that library, help me and give me some code example for get (x,y) of controls, i'm using visual studio 2010 and OS 7.1
I think GeoCoordinate is for GPS position, you can't use it to localise control in a grid.
However, you can use this code to localise control relatively to a grid or a stackPanel thank to the code below :
var transform1 = textBox1.TransformToVisual(grid);//Grid is your content panel
Point absolutePosition1 = transform1.Transform(new Point(0, 0));
var transform2 = textBox2.TransformToVisual(grid);//Grid is your content panel
Point absolutePosition2 = transform2.Transform(new Point(0, 0));
After that, you can compare them.
I wanted to draw a rectangle with rounded corners in SSRS. But, after lot of research i got to know that currently there is no property for that. So, i am trying to use an image of a rectangle with rounded corners and on top of that trying to align the table and other controls within the image. But, when i am previewing it or exporting it to a PDF file, first the image is getting displayed, then below that all other controls comes. Am i doing anything wrong. Please let me know.
Why don't you try to enclose your image rectangle and other controls etc. within an SSRS Rectangle with BorderStyle = None...
Try following:
Create an image (the rectangle with rounded corners) in your favourite image drawing program. I did mine in Microsoft Paint
and save it as JPEG.
In SSRS report design, in Report Data pane, right click on Images >> Add Image and point to the image that you created in Step 1. (Untitled, in my case see the fig. below)
In SSRS report design, add a Rectangle from the Toolbox to the design surface and in the Properties Pane:
a) look for the BackgroundImage property Click its + sign. then
b) Enter values for Source as Embedded, BackgroundRepeat as Clip and the Value property , when you click the dropdown for its values, should show you the name of the image that you embedded in Step-2, select this name
Resize your rectangle to fit the shape and add your items to this rectangle.
EDIT:
Regarding the question in the Comment, I don't think that the size of the image rectangle can be increased dynamically. If that's the case then you may need to find some other work-around
HTH