rotate image

ilse20

Registered User.
Local time
Today, 19:00
Joined
Apr 9, 2010
Messages
35
hello,

i don't know if it's possible. but i have an report which i generate from a table. in that table i have a field that contains a path where the image is at.

at the report i have a image control where i set the control source to that tablefield. but the problem is that the image is horizontal.
on the report i want to have the image vertically. is it possible to rotate the image with vba access?

many thanks.

ilse
 
Short of using an API for images (which I've seen posted a few years back), I don't know of a way to do it (although I'm not sure about 2007).

Otherwise I've seen API modules (again, a long, long time ago) which seemed to be able to manipulate images. I never used them firsthand so I couldn't say.
 
Its hard to rotate image with vba.

You can try the AccessImagine component we have developed - it can display external images and rotate em with Pic.TurnLeft and Pic.TurnRight VBA commands.
 
Last edited:
yeah i noticed it that it's hard to do that so i solved this another way. without rotating the image.

but thanks for your help anyway
 
i am looking at this again, because my boss said that it is possible. so now i took a look at accessimagine but it doesn't work with me the way you say it. i don't get the pic.turnleft and turnright.

any thoughts on that?
 
Once you have arranged AccessImagine to display proper image, you can write following in some record processing event (i.e. CurrentRecord)

[AccessImagine control name].TurnLeft

This will rotate the image every time new record is processed.
 
i'm sorry but i still don't get the turnleft property. maybe i ain't doing it the right way. could you give me a hand with this?
i have a report which i generate from a table and in that table is a path where the image is at. so the image can be differrent with each record.
 
Lets try step-by-step.

1. Create report, place AccessImagine component on it, name it "Pic".
2. In CurrentRecord event write two lines:
Pic.LoadFile(MyFile) - (instead of MyFile write the name of the field with image name with path)
Pic.TurnLeft

If you still have problems with this, just post your MDB and i'll make the changes to it.
 
i can't put the whole accdb on it. because there is a lot information in it from the company so i can't just put the whole accdb on here.
i will post the code that i use on this form.

i hope that you can help me this way. because i can't just put the whole accdb on here.

this is the code i use to generate the report:
Code:
 Dim rs_NewExtUpdate As DAO.Recordset
    Dim h_qdfnew As DAO.QueryDef
    Dim h_strSQL As String
    Dim h_stdocname As String
    Dim h_queryname As String
    Dim h_qdf As DAO.QueryDef
    Dim h_amountlabels As String
    Dim h_table As String
    Dim h_LabelFile As String
    Dim h_streport As String
    Dim h_hoofddir As String
    Dim h_file_name As String
    Dim h_filename As String

   
    h_stdocname = "label_sub_label"
    
    'DoCmd.OpenReport h_stdocname, acViewPreview, , , acWindowNormal

    'h_LabelFile = "\\virtualcomputing.biz\nlrdmfls01\tsh$\ivbroekhoven.VIRTUAL\Desktop\labels.pdf"
    h_strSQL = "SELECT * FROM Generate_labels WHERE ChangeUserName = '" & ChosenName & "' ;"
    h_queryname = "Query_labels"
    h_streport = "Labels_Query_labels_empty"
    h_table = "Generate_labels"
    
    
     For Each h_qdf In CurrentDb.QueryDefs
            If h_qdf.Name = h_queryname Then
                CurrentDb.QueryDefs.Delete (h_queryname)
            End If
        Next h_qdf
        
    Set h_qdfnew = CurrentDb.CreateQueryDef(h_queryname, h_strSQL)
    h_amountlabels = DCount("ChangeUserName", h_table, "ChangeUserName = '" & ChosenName & "'")
        
        If h_amountlabels < 1 Then
            MsgBox "No labels saved for current user" & vbNewLine & "Please save a label first"
        Else
            With DoCmd
                .SetWarnings False
                '.Close
                '.OpenReport h_stdocname, acViewPreview, , , acWindowNormal
                MsgBox "Don't forget to press the CLEAR LABELS button when you have printed the labels!"
                .OutputTo acOutputReport, h_stdocname, acFormatPDF, h_filename, True, , , acExportQualityPrint
                .SetWarnings True
            End With
        End If
        DoCmd.Close
    
Exit_Orderrequest_Click:
    Exit Sub

Err_Orderrequest_Click:
    MsgBox Err.Description
    Resume Exit_Orderrequest_Click
End Sub
 
Huh, thats a big piece of code. I hope it works at least :)

There is a lot of preparations in it, but there is no the report we need here. There is a report in your database called "label_sub_label". You need to make things i've said before to it.

Post here if you need further help.
 
this i a piece of the accdb. the table, the query and the report that i use i put in here. hopefully you can help me like this.
 

Attachments

i've been looking to some alternatieves and i found MODI. does anyone have expierence with this?
 
Huh, thats a big piece of code. I hope it works at least :)

There is a lot of preparations in it, but there is no the report we need here. There is a report in your database called "label_sub_label". You need to make things i've said before to it.

Post here if you need further help.

could you maybe give me an example of how to use accessimagine?
 
this i a piece of the accdb. the table, the query and the report that i use i put in here. hopefully you can help me like this.

Sorry for delay with my answer. Does the "Labels_Query_Labels" is the report you are talking about and "tpb_logo" is the picture you need to rotate?

If it is so, i've made the corrections i was talking before in attached file.
 

Attachments

Users who are viewing this thread

Back
Top Bottom