Applying Both A Rotation And Color Adjustment To A GDI DeviceContext Causes The Colours To Be Reset?

Sep 1, 2011

I am using API calls to transform a Bitmap object. I have various physical transformations (rotation, flipping, scaling, displacement) as well as some colour adjustments (inversion, brightness and contrast)Everything works fine except for when I use the rotation or shear transformations in combination with the colour adjustment. In that case the colours revert to the original image.The interesting thing about this problem is that it seems to be dependent on the off-diagonal factors (eM12 and eM21 below) in the XForm matrix. For example, here is the rotation matrix:

Public Sub RotateClockwise(Radians As Single)
With XFormMatrix
.eM11 = Cos(Radians)[code]....

is there some way I can use both SetWorldTransform and SetColorAdjustment when using non-zero values for the off-diagonal factors in my XForm transformation?

View 1 Replies


ADVERTISEMENT

How To Make A Color Curve Adjustment

May 17, 2012

How to make a color curve adjasment for editing colors of an image?I found a C# project on Mr.SkyDrive but the problem is the coloring adjasment, because the coloring adjasment wasn't as other programs adjasment it wasn't correct if you view the image closely you will see some red, pink, and green pixels: (the curve like this must make the image negative)

View 20 Replies

VS 2010 - Applying Different Color On Default Cursor?

Jan 18, 2012

In my program I have a picturebox. using the .onEnter and .onLeave events for the mouse I have the cursor change to a cross (one of the default cursors) and it does like a transparent grayscale thing and changes color a bit depending on what is behind it. The issue with that is that all the images I look at are grayscale images so it gets a bit lost. I am wondering if there is a way to use this default cursor and apply a different color to it?

View 1 Replies

Extract Pixel Colours From Images But It's Only Getting Colours From The Previously Loaded Image

Jul 4, 2011

Public Class Form1
Dim x As Integer, y As Integer
Dim img As Bitmap
Dim pixelColor As Color

Public Function getpixel(ByVal x As Integer, ByVal y As Integer) As Color End Function Private Sub find_img_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles find_img.Click

[Code]...

whenever i load the image, i have to load it a second time to get the colour, or if i load a new one, i get the colour from the previous image, any ideas as to why?

View 1 Replies

Excel - Code In VBA And Recording A Macro - Input A Values For The X Axis Rotation And The Y Axis Rotation

Sep 16, 2009

I am having some major problems with the code in VBA and recording a macro didn't get me anywhere nor is the VBA help file. I have to have it so that I can input a values for the x axis rotation and the y axis rotation so that my 3d surface graph will rotate whatever values I input, the 3d surface graph will rotate those degrees. I also have to have a method for having the default rotation. I was also wondering how to put scroll bars for the x and y rotation. The only other thing I am having trouble with is having an input to check box for right angle axes. So far I have two cells for entering the x rotation value and the y rotation value. I also already have my 3d surface graph.

View 3 Replies

VS 2008 - How To Reset RichTextBox (Selection Color)

Jun 21, 2012

How do you reset a RichTextBox? I wrote some code that changes the
RichTextBox1.SelectionColor = Color.White and
RichTextBox1.SelectionBackColor = Color.Red.
I'd like to change all the text in the RichTextBox back to Black and no back color.

View 2 Replies

Programmatically Reset Form Background From A Picture To A Solid Color?

Nov 13, 2009

How can I programmatically reset my form background from a picture to a solid color. I have no trouble changing it to a picture or even changing it to another picture, but when I try to change it back to a solid color, it won't work.

me.backcolor=color.red 'OK
me.backgroundimage=my.resources.dog 'OK
me.backgroundimage=(none) 'error
me.backgroundimage=my.resources.none 'error

How do I reset it back to a color? It's stuck in a picture mode.

View 2 Replies

Asp.net - SQL String Adjustment For Drop Down Lists?

Oct 31, 2011

I'll try to clarify by using the following example. In here I have two Drop down lists (ddlInsertEmployee + ddlInsertCustomer) which should both be bound to fetch data from tables [Employee.EmployeeID] and [Customer.CustomerID] and insert it into table [Task].

The problem is that it inserts data from Employee.Fullname and Customer.Fullname into resp.Employee.EmployeeID and Customer. CustomerID.If I would change the Drop down lists to textboxes, and manually insert the IDs, it works like a charm, but this is not very efficient, I want to be able to see the entire Fullname.how to change my Sqlstring in order to make this work correctly.

Imports System
Imports System.Collections.Generic
Imports System.Data[code].......

View 1 Replies

VS 2008 Console.Beep Speed Adjustment?

May 8, 2009

i'm creating an alarm clock for my computer. my alarm is the console.beep() sound. can I somehow alter the interval speed between the beeps using a trackbar? here is my code so far. all i want to know is how i would go about doing this, i like to learn the specific code on my own.

vb
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblTime = lblTime

[code]....

View 2 Replies

Clear And Reset All Of These By Clicking A Reset Button?

Jun 4, 2011

I got on my form textboxes, checboxes but also a groupbox which holds texboxes.

The idea is to be able to clear and reset all of these by clicking a reset button.

At the moment i got this
Private Sub ClearFields()
Dim ctrl As Control

[Code].....

But ofc Me.controls isn't gonna get involved with the stuff in the groupbox.

View 4 Replies

Reset Button To Reset Player

May 29, 2009

Ok, so I am building my own program to control a video player I have through telnet, I have everything else working except one thing.I have a reset button to reset the player, when I press it, it sends the string "Reset" and the unit resets without a problem.But when I add a code to close the winsock connection upon reset, it doesn't send the string to the unit. I am sure what is happening is the winsock is getting closed at the exact same time it is trying to send the string and so it fails to send, how do I make it close winsock AFTER the string has been sent? [code]

View 1 Replies

Axis Of Rotation In Vb?

Jan 29, 2011

I have created some 3d models(VB) for display in a WPF 3d Viewport and would like to rotate them. I would like to rotate them about an axis of rotation defined by a line through two 3d points. All the examples seem to rotate about one of X Y or Z axes and are not helpful for a more general approach. The angle of rotation is easily found. My maths is a bit rusty now so is there a function that would calculate the axis easily ?

View 2 Replies

Bitmap Rotation Using GDI+

Dec 26, 2009

explain how Graphics.RotateTransform is working?

[Code]...

View 6 Replies

3D Object Rotation In 2008?

May 19, 2009

I'm developing a sun shading analysis tool, and part of the analysis involves rotating a house (modelled as a cube consisting of 8 points) by the solar azimuth and solar altitude angles. The reason for this is to determine if the wall in question is facing the sun, and if so I run a shading analysis using a scanline algorithm to determine the percentage of wall plane that is in shade from a tree in the yard (this is modeled using overlapping 2D polygons). The purpose of the rotation and tilt of the object is so that the wall plane is directly perpendicular to the sun, so that the analysis can be done in 2D as opposed to 3D.

I first rotate each point of the house (which is stored in an array) through the azimuth, and then tilt it up through the solar altitude angle. I have set up my 3D coordinate system using the standard right-hand rule for orientation of the x,y,z axes. I'm using a basic rotation matrix as follows:For the azimuth, I am rotating around the z-axis, so I am using the following matrix transformation.
[x',y'] = [x*cos(azimuth) - y*sin(azimuth) , x*sin(azimuth) + y cos(azimuth)]For the altitude, I am rotating the object about the x-axis to tilt it up. I use the initial z-coordinate and the transformed y'-coordinate for the altitude tilt calculation.Each point, when completely rotated and tilted, will have a distinct set of coordinates: [x', y'', z'].Individually, the rotation and tilt work fine. But when I try to do them consecutively, I run into problems.

View 4 Replies

Change Rotation Of A PDF Document?

May 3, 2012

I am first time working on PDF documents.I was searching on Rotation of a PDF page. I got some code samples regarding rotations by 90,180,270,360 degrees.

But my problem is that if there is a very small rotation required of the order of few degrees .. Is there any way that we can specify an angle using a slider bar or use the mouse to click and rotate the PDF page...

View 3 Replies

Does Not Keep Track Of The Actual Rotation

Apr 1, 2011

I have a screen full of puzzle peices they are all rotated at different angles (90,180,270). is there a way to track the peices rotation? I was thinking of using a 2d array to store there rotation. however, I am using this code to rotate the peices:

[Code]...

View 6 Replies

Get The Center Point Of A Rotation?

Jan 24, 2010

i'm developing a simple 2d animation program. my task is to get the center point of a rotation, for example: at the frame 0 there is a rectangle at x,y coordinates and with 0° of rotation at the frame 10 there is the same rectangle, translated and rotated what is the center point around which the rotation occurred? This is not really a question about programming, i know, rather than a problem of geometry.

View 1 Replies

Rotate Image Like 3d Rotation?

May 12, 2012

how to rotate image like 3d rotation?

View 2 Replies

C++ - Direction Of Shortest Rotation Between Two Vectors

Jun 13, 2012

my question is regarding working out the direction of the smallest angle between two vectors in 2D. I am making a game in C++ where one of the obstacles is a heat seeking missile launcher. I have it working by calculating the vector between the target and bullet, normalising the vector and then multiplying it by its speed. However, I am now coming back to this class to make it better. Instead of instantly locking onto the player I want it to only do so only when the bullets vector is within a certain angle (the angle between the bullets vector and the vector bulletloc->target). Otherwise I want it to slowly pan towards the target by a degrees thus giving the player enough space to avoid it. I have done all this (in a vb.net project so i could simplify the problem, work it out then re write in in C++). However the bullet always rotates clockwise towards the target even if the quickest route would be counter clockwise. So the problem is working out the direction to apply the rotation in so the smallest angle is covered. Here is my code so you can try and see what I am describing:

Function Rotate(ByVal a As Double, ByVal tp As Point, ByVal cp As Point, ByVal cv As Point)
'params a = angle, tp = target point, cp = current point, cv = current vector of bullet'

[Code]...

I had was to work out the bearing of the two vectors and if the difference is greater than 180 degrees, rotate clockwise otherwise rotate counter clockwise

View 1 Replies

DirectX.Direct3D Rotation And Textures?

Mar 12, 2011

SI like doing random things like 3D objects inside a windows form. With that said, I'm creating an application that will, eventually, write the code for me, after I do it myself visually.If you run the app it will make some more sense I guess.Now, to rotate the cubes, I'm using

.Transform.World = Matrix.RotationYawPitchRoll(CSng(CubeRx(1) / 10), CSng(-CubeRy(1) / 10), CSng(CubeRz(1) / 10))

now I do not want the world to rotate, just my individual cubes.Here's an example of me referring to my cube in action

If howmanycubes >= 1 Then
' vb2 = New VertexBuffer(GetType(CustomVertex.PositionNormalColored), 36, d, Usage.Dynamic And Usage.WriteOnly, CustomVertex.PositionColored.Format, Pool.Default)

[code]....

how to apply textures to the cube.instructions:When running the program, type in values on right side and click create cube.before you click create cube again, those same text boxes will adjust your current cube.Then when you click create new, it places another cube ontop of your current cube, so you'll need to give it new values.Not much validation is going on so some bad values will cause crashes.

View 1 Replies

Get Text Field Rotation With ITextSharp?

Jun 4, 2009

What I need to do is query an iTextSharp AcroField to check if it is rotated, and if so capture the value of the rotation.So If I have the following field:

Dim af As iTextSharp.text.pdf.AcroFields = stamper.AcroFields
Dim afi As iTextSharp.text.pdf.AcroFields.Item
afi = af.GetFieldItem("fieldName")

What do I need to do to get the rotation (in degrees) of that specific field?

View 1 Replies

Custom User Control Graphics Rotation?

May 31, 2010

I'm trying to build a dial control as a custom user control in VB.NET. I'm using VS2008.so far I have managed to rotate image using graphics.rotatetransform . however, this rotate everything. Now I have a Bitmap for the dial which should stay stable and another Bitmap for the needle which I need to rotate.so far i've tried this:

Dim gL As Graphics = Graphics.FromImage(bmpLongNeedle)
gL.TranslateTransform(bmpLongNeedle.Width / 2, bmpLongNeedle.Height * 0.74)
gL.RotateTransform(angleLongNeedle)[code].....

As I understand it, the image of the needle should be rotated at angle "angleLongNeedle" although i'm placing the rotated image at 0,0. However, the result is that the Needle doesn't get drawn on the control.

View 2 Replies

Extract Transform And Rotation Matrices From Homography?

Sep 12, 2011

I have 2 consecutive images from a camera and I want to estimate the change in camera pose:

I calculate the optical flow:

Const MAXFEATURES As Integer = 100
imgA = New Image(Of [Structure].Bgr, Byte)("pic1.bmp")
imgB = New Image(Of [Structure].Bgr, Byte)("pic2.bmp")
grayA = imgA.Convert(Of Gray, Byte)()

[Code]...

How do I calculate the new position and lookat?

If I'm doing this all wrong or if there's a better method,

View 1 Replies

Find Shift And Rotation Between Same Two Images Using Programming Languages C++ Or C#?

Sep 1, 2009

How to find shift and rotation between same two images using programming languages vb.net or C++ or C#?

View 5 Replies

Different Colours In Same Textbox?

Feb 2, 2011

I have a text box where I write different frames from a serial port.

I'd like to write those frames in two different colours but I don't know how to do it.

If I change the option Textbox.Forecolor, it changes the colour of every single line, and that's not what I am trying...

View 3 Replies

Applying Changes To A DataGridView

May 12, 2010

I'm allowing users to change data in a DGV. Is there some kind of built in method for DGVs that updates the table with the new values in my Access database? I have a save button that performs the following:

[Code]....

View 2 Replies

Game Programming :: Screen Rotation Handling With Compact Framework

Oct 4, 2008

I am developing a game in compact framework. In Mobile Devices there is a button that Rotates the screen by 90 degrees so you can hold the mobile device the way that suits you. The problem is that i want to handle that in my game, so if i see that the screen has rotated the game will pause.

[Code]...

View 2 Replies

Editing Colours Automatically?

May 25, 2012

With my program I have made a settings form - changing the colour of other forms- and instead of writing the code for each individual form I was thinking if I can create an automatic system. The forms have different types of names & the items within have different names.In the setting form i have 3 color dialogs (one for background,Text colour -labels-, and a button color -forecolor-)

Code for Formsettings

Public Background As Color
Public TextForecolour As Color
Public buttontext As Color[code]......

View 8 Replies

Get Font Colours To Change?

Jan 12, 2010

i cant remember how to get font colours to change, so thought doining it with the hello world would be best

View 1 Replies

VS 2008 : Using Non Standard Colours In DGV?

Sep 6, 2009

I have a colour that is not predefined and I want to change the selectionbackcolor in a DGV. In the DGV it is defined as 255,255,192.

RoomNamesDGV.DefaultCellStyle.SelectionBackColor = " a colour "

How do I set the colour using 255,255,192.I need to do this as I have 2 DGV side by side and I want to show where the focus lies.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved